-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improve the problem of inaccurate captcha accuracy (#4401)
* feat: captcha example * fix: fix lint errors * chore: event handling and methods * chore: add accessibility features ARIA labels and roles * refactor: refactor code structure and improve captcha demo page * feat: add captcha internationalization * chore: 适配时间戳国际化展示 * fix: 1. 添加点击位置边界校验,防止点击外部导致x,y误差。2. 演示页面宽度过长添加滚动条。3. 添加hooks ---------
- Loading branch information
1 parent
b8a4fba
commit 38fe642
Showing
3 changed files
with
47 additions
and
36 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
packages/effects/common-ui/src/components/captcha/hooks/useCaptchaPoints.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { CaptchaPoint } from '../types'; | ||
|
||
import { reactive } from 'vue'; | ||
|
||
export function useCaptchaPoints() { | ||
const points = reactive<CaptchaPoint[]>([]); | ||
function addPoint(point: CaptchaPoint) { | ||
points.push(point); | ||
} | ||
function clearPoints() { | ||
points.splice(0, points.length); | ||
} | ||
return { | ||
addPoint, | ||
clearPoints, | ||
points, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters