qb-verify
v0.2.1
Published
A simple scroll verify vue component for vanchu tech. Readme for usage.
Downloads
15
Readme
qb-verify
Installing
Using npm:
$ npm install qb-verify
Usage
(In main.js)
import QbVerify from 'qb-verify'
Vue.use(QbVerify, {
appId: 'your appId' // require
})
(In your controller)
// getVerifyCode
let params = {
mobile: 'user mobile', // require
type: 'register' // require, such as 'register'
}
this.$verification.getVerifyCode(params).then(_ => {
// 飘字提示 发送成功
}).catch(err => {
if (err && err.status) {
switch (err.status) {
case 1: // denied 禁止发送验证码
// 飘字提示
break
case 3: // FREQUENCY_LIMIT(频率限制)
// 飘字提示
break
default:
break
}
} else {
// 未知错误
}
})
// checkVerifyCode
let params = {
mobile: 'user mobile', // require
verifyCode: '1234', // require, captcha
type: 'register' // require, such as 'register'
}
this.$verification.checkVerifyCode(params).then(res => {
}).catch(err => {
})