human-verify 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -4
- package/frontend/human-verify.es.js +1 -1
- package/frontend/human-verify.umd.js +1 -1
- package/package.json +2 -7
package/README.md
CHANGED
|
@@ -31,7 +31,9 @@ import { HumanVerify } from 'human-verify'
|
|
|
31
31
|
|
|
32
32
|
<template>
|
|
33
33
|
<HumanVerify
|
|
34
|
-
|
|
34
|
+
challenge-url="/api/verify/challenge"
|
|
35
|
+
pow-challenge-url="/api/verify/pow-challenge"
|
|
36
|
+
pow-verify-url="/api/verify/pow-verify"
|
|
35
37
|
@verified="onVerified"
|
|
36
38
|
@failed="onFailed"
|
|
37
39
|
/>
|
|
@@ -44,7 +46,9 @@ import { HumanVerify } from 'human-verify'
|
|
|
44
46
|
import { humanVerify } from 'human-verify'
|
|
45
47
|
|
|
46
48
|
const result = await humanVerify({
|
|
47
|
-
|
|
49
|
+
challengeUrl: '/api/verify/challenge',
|
|
50
|
+
powChallengeUrl: '/api/verify/pow-challenge',
|
|
51
|
+
powVerifyUrl: '/api/verify/pow-verify',
|
|
48
52
|
onProgress: (progress, status) => {
|
|
49
53
|
console.log(`${progress}%: ${status}`)
|
|
50
54
|
}
|
|
@@ -62,7 +66,12 @@ if (result.passed) {
|
|
|
62
66
|
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
|
|
63
67
|
<script src="/lib/human-verify.umd.js"></script>
|
|
64
68
|
|
|
65
|
-
<human-verify
|
|
69
|
+
<human-verify
|
|
70
|
+
challenge-url="/api/verify/challenge"
|
|
71
|
+
pow-challenge-url="/api/verify/pow-challenge"
|
|
72
|
+
pow-verify-url="/api/verify/pow-verify"
|
|
73
|
+
onverify-id="my-callback"
|
|
74
|
+
></human-verify>
|
|
66
75
|
|
|
67
76
|
<script>
|
|
68
77
|
window.HumanVerifyCallbacks.set('my-callback', (result) => {
|
|
@@ -79,7 +88,9 @@ if (result.passed) {
|
|
|
79
88
|
|
|
80
89
|
| 属性 | 类型 | 默认值 | 说明 |
|
|
81
90
|
|------|------|--------|------|
|
|
82
|
-
| `
|
|
91
|
+
| `challenge-url` | `string` | `'/api/verify/challenge'` | 获取挑战接口 URL |
|
|
92
|
+
| `pow-challenge-url` | `string` | `'/api/verify/pow-challenge'` | 提交行为验证 + POW 挑战接口 URL |
|
|
93
|
+
| `pow-verify-url` | `string` | `'/api/verify/pow-verify'` | 提交 POW 结果接口 URL |
|
|
83
94
|
| `timeout` | `number` | `30000` | 超时时间(ms) |
|
|
84
95
|
| `onverify-id` | `string` | — | 回调 ID,通过 `window.HumanVerifyCallbacks.set(id, fn)` 注册 |
|
|
85
96
|
|