install
cnpm i verifition-tools --save
- blockPuzzle 滑块模式
- clickWord 单词点击模式(目前不可用)
import {useRef,useEffect} from 'react'
import Verify from './Verify'
import type {VerifyRef} from './Verify'
const Page ()=>{
const verifyRef = useRef<VerifyRef>(null)
// 验证成功回调
const successBack = ()=>{
console.log('验证成功回调')
}
useEffect(()=>{
// 显示滑块 建议点击登录时候调用
verifyRef.current?.show()
},[])
return <Verify captchaType="blockPuzzle" mode="pop" ref={verifyRef} successBack={successBack} />
}
export default Page
1.0.1 初始化版本