Commit 302184ab authored by 谢子梦's avatar 谢子梦

stage:登录重复提交BUG 获取验证码后自动获取光标

parent 100a7c2c
......@@ -104,6 +104,7 @@
import { getCodeImg, getLoginSmsCode } from '@/api/login'
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
import { set } from 'nprogress';
export default {
name: "Login",
......@@ -143,7 +144,9 @@ export default {
VerificationCodeTime: 60,
VerificationCodeTitle: null,
// 重新发送验证码弹窗
dialogVisible: false
dialogVisible: false,
// 节流参数控制
throttle: null,
};
},
watch: {
......@@ -180,7 +183,12 @@ export default {
}
});
if (code.length == 6) {
if (!this.throttle) {
this.throttle = setTimeout(() => {
this.handleLogin(code)
this.throttle = null
}, 500)
}
}
this.$forceUpdate()
},
......@@ -263,6 +271,11 @@ export default {
this.textMessageShow = false
this.countdownMethod()
this.$forceUpdate()
setTimeout(() => {
this.$nextTick(() => {
this.$refs.firstInputRef.focus()
})
}, 1000)
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment