fix: 修复创建项目后进入新项目页面跳回到系统设置的问题
This commit is contained in:
parent
271b375b43
commit
f557a88d31
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue