Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fj-captcha-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
郑磊
fj-captcha-service
Commits
37e0f03c
Commit
37e0f03c
authored
May 17, 2024
by
郑磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新说明文档
parent
fca3118a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
README.md
README.md
+46
-1
No files found.
README.md
View file @
37e0f03c
...
@@ -36,9 +36,54 @@ https://captcha.service.briefmsg.cn/?lang=xxxx&bg=%23ff0000&shadow=1&radius=1&ex
...
@@ -36,9 +36,54 @@ https://captcha.service.briefmsg.cn/?lang=xxxx&bg=%23ff0000&shadow=1&radius=1&ex
1.
引入npm库
1.
引入npm库
```
shell
```
shell
npm i git+http://gitlab.3yakj.com/crystalray/fj-captcha-
service.git/vue
npm i git+http://gitlab.3yakj.com/crystalray/fj-captcha-
vue.git
```
```
2.
在入口文件中引用样式
```
javascript
import
'fj-captcha-vue/esm/style.css'
```
3.
引入组件
```
javascript
import
{
Captcha
}
from
'fj-captcha-vue'
```
```
<Captcha
:requestCaptchaDataUrl="requestCaptchaDataUrl"
:validCaptchaUrl="validCaptchaUrl"
:showClose="showClose"
:locale="locale"
:extra="extra"
@close="onClose"
@success="onSuccess"
/>
```
属性说明
| 属性名 | 类型 | 必需 | 说明 |
| --------------------- | ------ | ---- | --------------------------------------------------------------------------------- |
| requestCaptchaDataUrl | string | 是 | 获取验证码的数据的地址
`https://captcha.service.briefmsg.cn/api/captcha/generate`
|
| validCaptchaUrl | string | 是 | 校验验证码数据的地址
`https://captcha.service.briefmsg.cn/api/captcha/check`
|
| showClose | bool | 否 | 是否显示关闭按钮,默认为
`false`
|
| locale | string | 否 | 显示的语言,支持
`zh-CN`
,
`zh-TW`
,
`en`
,不传则自动根据浏览器环境获取 |
| extra | object | 否 | 额外校验数据,用于服务端校验信息的合法性 |
事件说明
| 事件名 | 参数签名 | 说明 |
| ------- | --------------------- | ---------------------------- |
| close | 无 | 用户点击关闭按钮时触发的事件 |
| success | (key: string) => void | 当验证码校验完成时触发的事件 |
### React
正在开发中...
## 服务端接入
## 服务端接入
当前端收到验证完成事件,收到了验证标识之后,可以传递给服务端,由服务端调用验证服务进行数据校验,校验通过后即可执行自身的业务逻辑。
当前端收到验证完成事件,收到了验证标识之后,可以传递给服务端,由服务端调用验证服务进行数据校验,校验通过后即可执行自身的业务逻辑。
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment