|
|
@@ -31,8 +31,56 @@ export default { |
|
|
|
code: [{ required: true, trigger: "blur", message: "验证码不能为空" }], |
|
|
|
// smsCode: [{ required: true, trigger: "blur", message: "验证码不能为空" }] |
|
|
|
}, |
|
|
|
redirect: undefined, |
|
|
|
}; |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
$route: { |
|
|
|
handler: function (route) { |
|
|
|
this.redirect = route.query && route.query.redirect; |
|
|
|
console.log(route) |
|
|
|
if (route.query && route.query.code && route.query.exiturl) { |
|
|
|
let obj = { |
|
|
|
code: route.query.code, |
|
|
|
}; |
|
|
|
this.singleLoading = true; |
|
|
|
this.$store |
|
|
|
.dispatch("SingleLogin", obj) |
|
|
|
.then((res) => { |
|
|
|
Cookies.set("singleUrl", route.query.exiturl, { expires: 30 }); |
|
|
|
this.singleLoading = false; |
|
|
|
if (this.viewChecked == true) { |
|
|
|
this.$router.push({ path: "/viewPages/profile" }); |
|
|
|
} else { |
|
|
|
if (res && res.code && res.code == 200) { |
|
|
|
let requireUpdatePassword = res.requireUpdatePassword; |
|
|
|
if (requireUpdatePassword) { |
|
|
|
//重置密码 |
|
|
|
this.$set(this.resetPwd, "open", true); |
|
|
|
} else { |
|
|
|
this.$router |
|
|
|
.push({ path: this.redirect || "/" }) |
|
|
|
.catch(() => {}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
const errorString = error + ""; |
|
|
|
this.loading = false; |
|
|
|
if (errorString.indexOf("证书无效") > -1) { |
|
|
|
loginError().then((res) => { |
|
|
|
this.upload.open = true; |
|
|
|
this.upload.loginJson = res.msg; |
|
|
|
}); |
|
|
|
} |
|
|
|
this.singleLoading = false; |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
immediate: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
}, |
|
|
|
created () { |
|
|
@@ -136,8 +184,8 @@ export default { |
|
|
|
//重置密码 |
|
|
|
this.$set(this.resetPwd, "open", true); |
|
|
|
} else { |
|
|
|
this.$router |
|
|
|
.push({ path: this.redirect || "/nav" }) |
|
|
|
console.log(this.redirect + 11111111111); |
|
|
|
this.$router.push({ path: this.redirect || "/nav" }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|