@pansy/smart-captcha
TypeScript icon, indicating that this package has built-in type declarations

3.3.0 • Public • Published

@pansy/smart-captcha

阿里巴巴集团提供的一种智能验证码解决方案。

coverage CI deploy CI NPM version NPM downloads codecov license issues Percentage of issues still open Average time to resolve an issue dumi

📝 阿里文档

文档

🏗 安装

# npm install
npm install @pansy/smart-captcha --save

# yarn install
yarn add @pansy/smart-captcha

# pnpm install
pnpm i @pansy/smart-captcha

🔨 使用

import { SmartCaptcha } from '@pansy/smart-captcha';

export default () => {
  <SmartCaptcha />
}

注意:

qiankun 项目中 使用时由于沙盒的原因导致组件加载不出来,可通过 excludeAssetFilter 配置排除 //g.alicdn.com/AWSC/AWSC/awsc.js;

如果使用 umi 只需要在基座项目里中的 src/app.ts 文件里添加如下代码即可

const cdnUrls =  [
  '//g.alicdn.com/AWSC/AWSC/awsc.js',
];

function isQuankuExclude(value: string) {
  let result = false;

  for (let i = 0; i < cdnUrls.length; i++) {
    if (value.includes(cdnUrls[i])) {
      result = true;
      break;
    }
  }

  return result;
}

export const qiankun = Promise.resolve().then(() => ({
  excludeAssetFilter: (assetUrl: string) => {
    return isQuankuExclude(assetUrl);
  }
}));

Readme

Keywords

none

Package Sidebar

Install

npm i @pansy/smart-captcha

Weekly Downloads

2

Version

3.3.0

License

MIT

Unpacked Size

24.9 kB

Total Files

7

Last publish

Collaborators

  • wangxingkang