1.用法
1.在public里面的index.html文件中引入:
<script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
//使用:
const appId = "xxxx" //腾讯滑块验证码appid
sendSms() {
this.form.validateFields(["phone"], (err, values) => {
if (err) return;
const phone = values.phone;
const captcha = new TencentCaptcha(appId, (res) => {
if (res.ret !== 0) return;
anonUserResetPwdSmsCaptcha(phone, res).then(() => {
this.reSend = true;
this.countDown();
this.$message.success("验证码已发送,请注意查收!");
});
});
captcha.show(); // 显示验证码
});