npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

taro-anji-verify

v1.0.11

Published

Taro version of anji-plus-verify

Downloads

22

Readme

taro-anji-verify

基于 Taro 和 React 的安吉验证码组件库 (Anji Plus Verify for Taro)。 支持滑动拼图验证 (Block Puzzle) 和文字点选验证 (Click Word)。

安装

npm install taro-anji-verify
# 或者
yarn add taro-anji-verify
# 或者
pnpm add taro-anji-verify

使用

引入组件

import { VerifySlide, VerifyPoint, VerifySlideFixed, VerifyPointFixed } from 'taro-anji-verify';

1. 弹窗式滑动验证 (VerifySlideFixed)

最常用的方式,点击按钮弹出验证码。

import { useState } from 'react';
import { View, Button } from '@tarojs/components';
import { VerifySlideFixed } from 'taro-anji-verify';

export default () => {
  const [showVerify, setShowVerify] = useState(false);

  const handleVerifyResult = (result: boolean) => {
    if (result) {
      console.log('验证成功');
      // 执行后续逻辑,例如登录
    }
    // 关闭验证码弹窗
    setShowVerify(false);
  };

  return (
    <View>
      <Button onClick={() => setShowVerify(true)}>点击验证</Button>
      
      <VerifySlideFixed
        baseUrl="https://your-api-domain.com"  {/* 必填:后端接口地址 */}
        isSlideShow={showVerify}               {/* 控制显示/隐藏 */}
        verifyPointFixedChild={handleVerifyResult} {/* 回调函数 */}
      />
    </View>
  );
};

2. 嵌入式滑动验证 (VerifySlide)

直接在页面中显示验证码区域。

<VerifySlide
  baseUrl="https://your-api-domain.com"
/>

3. 弹窗式文字点选验证 (VerifyPointFixed)

<VerifyPointFixed
  baseUrl="https://your-api-domain.com"
  isPointShow={showPointVerify}
  verifyPointFixedChild={(result) => {
     console.log('验证结果:', result);
     setShowPointVerify(false);
  }}
/>

4. 嵌入式文字点选验证 (VerifyPoint)

<VerifyPoint
  baseUrl="https://your-api-domain.com"
/>

参数说明 (Props)

通用参数

| 参数名 | 类型 | 必填 | 默认值 | 说明 | |---|---|---|---|---| | baseUrl | string | | - | 后端接口的基础地址 (例如: https://api.example.com)。组件会自动拼接 /captcha/get/captcha/check。 | | imgSize | object | 否 | { width: '310px', height: '200px' } | 图片容器尺寸 | | barSize | object | 否 | { width: '310px', height: '40px' } | 滑块/操作栏尺寸 | | vSpace | number | 否 | 5 | 图片与控制栏的垂直间距 |

Fixed 组件特有参数 (VerifySlideFixed, VerifyPointFixed)

| 参数名 | 类型 | 说明 | |---|---|---| | isSlideShow / isPointShow | boolean | 控制弹窗显示或隐藏 | | verifyPointFixedChild | (result: boolean) => void | 验证结果回调。true 表示验证成功,false 表示关闭或失败。 |

注意事项

  1. 依赖: 确保项目已安装 @tarojs/taro, @tarojs/componentsreact
  2. 样式: 组件内部引入了 index.scss,请确保你的构建配置支持 SCSS 导入。
  3. 后端接口: 需要配合 Anji-Plus 的后端服务使用。

License

MIT