|
|
@@ -181,18 +181,17 @@ export default {
|
|
|
},
|
|
|
checkFirstLogin() {
|
|
|
getFirstLogin().then(res => {
|
|
|
+ this.loading = false;
|
|
|
if (res.code === 200 && res.data) {
|
|
|
- // 将首次登录状态存储到本地
|
|
|
- localStorage.setItem('isFirstLogin', res.data ? 'true' : 'false');
|
|
|
- // 如果是首次登录,跳转到设置密码页面
|
|
|
+ localStorage.setItem('isFirstLogin', 'true');
|
|
|
this.$router.push('/set-password');
|
|
|
} else {
|
|
|
- // 否则进入首页
|
|
|
+ localStorage.setItem('isFirstLogin', 'false');
|
|
|
this.$router.push({ path: this.redirect || "/" });
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
this.loading = false;
|
|
|
- this.getCode();
|
|
|
+ this.$router.push({ path: this.redirect || "/" });
|
|
|
});
|
|
|
},
|
|
|
getCode() {
|
|
|
@@ -244,13 +243,8 @@ export default {
|
|
|
.dispatch("Login", {...this.loginForm, captchaOnOff: this.captchaOnOff})
|
|
|
.then(res => {
|
|
|
if (res.needSms) {
|
|
|
- this.wechatDialogVisible = true;
|
|
|
- // 等 visible 更新后,直接调用弹窗 open()
|
|
|
- this.$nextTick(() => {
|
|
|
- if (this.$refs.wechatDialog) {
|
|
|
- this.$refs.wechatDialog.open(this.loginForm.username);
|
|
|
- }
|
|
|
- });
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.warning('需要短信验证,但验证组件未启用,请联系管理员');
|
|
|
} else {
|
|
|
// 登录成功后检查是否是首次登录
|
|
|
this.checkFirstLogin();
|