xiaoxiao0

<img class="code-img" @click="getCaptcha()" ref="captcha" src="接口地址" alt/>

import { VerifyCode } from "@/api/account";
export default {
data() {
return {
verify_code: "",
};
},
methods: {
async LoginBtn() {
let { code, msg, data } = await Login({
verify_code: this.verify_code,
});
},

// 点击更换验证码
getCaptcha(event) {
  var num = Math.ceil(Math.random() * 10);
  this.$refs.captcha.src = "https://test.npn.sg/npnsysapi/verify_code?" + num;
},

};

分类:

技术点:

相关文章: