fix: 修复创建项目后进入新项目页面跳回到系统设置的问题

This commit is contained in:
CaptainB 2022-10-20 16:24:07 +08:00 committed by 刘瑞斌
parent 271b375b43
commit f557a88d31
3 changed files with 9 additions and 10 deletions

View File

@ -106,8 +106,6 @@ export default {
.then(response => {
this.$setLang(response.data.language);
// MeterSphereX.showHome(this);
if (window.location.href.endsWith('/#/login')) {
window.location.replace("/#/setting/personsetting");
}

View File

@ -1,7 +1,7 @@
import Vue from "vue"
import Router from "vue-router"
import Layout from "../business/app-layout"
import {getCurrentUser, getCurrentUserId} from "../utils/token";
import {getCurrentUserId} from "../utils/token";
import {hasPermissions} from "../utils/permission";
import {SECOND_LEVEL_ROUTE_PERMISSION_MAP} from "../utils/constants";
@ -66,7 +66,14 @@ router.beforeEach(async (to, from, next) => {
const {useUserStore} = await import('@/store');
store = useUserStore()
}
const user = store.currentUser
let user = store.currentUser
if (to.path.split('/')[1] !== from.path.split('/')[1]) {
try {
user = await store.getIsLogin();
} catch (e) {
// console.error(e);
}
}
if (user && user.id) {
redirectLoginPath(to.fullPath, next);
} else {

View File

@ -301,12 +301,6 @@ export default {
this.loading = promise.then(() => {
this.createVisible = false;
this.$success(this.$t('commons.save_success'));
if (!this.form.id) {
setTimeout(() => {
window.location.reload();
}, 400);
return;
}
this.reload();
});
});