refactor(login/index.vue): 移除v-on废弃的native属性,TypeScript接口调用完善
This commit is contained in:
@@ -190,8 +190,7 @@ function handleLogin() {
|
|||||||
loginFormRef.value.validate((valid: boolean) => {
|
loginFormRef.value.validate((valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
state.loading = true;
|
state.loading = true;
|
||||||
user
|
user.login(state.loginForm)
|
||||||
.login(state.loginForm)
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
router.push({ path: state.redirect || "/", query: state.otherQuery });
|
router.push({ path: state.redirect || "/", query: state.otherQuery });
|
||||||
state.loading = false;
|
state.loading = false;
|
||||||
@@ -208,8 +207,8 @@ function handleLogin() {
|
|||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
function handleCaptchaGenerate() {
|
function handleCaptchaGenerate() {
|
||||||
getCaptcha().then((response) => {
|
getCaptcha().then(({data}) => {
|
||||||
const { img, uuid } = response.data;
|
const { img, uuid } = data;
|
||||||
state.captchaBase64 = "data:image/gif;base64," + img;
|
state.captchaBase64 = "data:image/gif;base64," + img;
|
||||||
state.loginForm.uuid = uuid;
|
state.loginForm.uuid = uuid;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user