登陆逻辑修改
This commit is contained in:
parent
5c5c2412fd
commit
6fa2b2e636
@ -173,20 +173,8 @@ export default {
|
||||
model.project = this.$route.params.project;
|
||||
removeSessionStorage('againEnter');
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('GetUserConfigInfo');
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
let path = localStore.get('trainingPlatformRoute'+model.username);
|
||||
if (!path || !path.startsWith('/trainingPlatform')) {
|
||||
path = UrlConfig.trainingPlatform.trainingPlatformHome;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
@ -237,15 +225,7 @@ export default {
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
let path = '/login';
|
||||
if (this.project) {
|
||||
path = path + '/' + this.project;
|
||||
}
|
||||
self.$router.push({ path: path });
|
||||
self.$nextTick(() => {
|
||||
self.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.handleLoginSucessRoute();
|
||||
});
|
||||
}).catch(error => {
|
||||
if (error.data && error.data.status == '1') {
|
||||
@ -278,20 +258,8 @@ export default {
|
||||
}
|
||||
removeSessionStorage('againEnter');
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('GetUserConfigInfo');
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
let path = localStore.get('trainingPlatformRoute'+model.username);
|
||||
if (!path || !path.startsWith('/trainingPlatform')) {
|
||||
path = UrlConfig.trainingPlatform.trainingPlatformHome;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
@ -302,7 +270,18 @@ export default {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
const path = UrlConfig.trainingPlatform.trainingPlatformHome;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user