代码调整
This commit is contained in:
parent
a3e908d1c2
commit
e55a0de42f
@ -114,7 +114,7 @@ router.beforeEach( async (to, from, next) => {
|
||||
// }
|
||||
const response = await getFrontProjectConfigByLogin(project);
|
||||
if (response.data) {
|
||||
const {browserTitle, loginProLogo, baseApiUrl, baseSite, ossUrl} = response.data.viewSetting;
|
||||
const {browserTitle, loginProLogo, baseApiUrl, baseSite, caseShow, ossUrl} = response.data.viewSetting;
|
||||
if (!store.state.user.baseUrl && project) {
|
||||
const urlData = handlerUrl();
|
||||
store.dispatch('setBaseUrl', baseApiUrl || urlData.BASE_API);
|
||||
@ -124,6 +124,7 @@ router.beforeEach( async (to, from, next) => {
|
||||
}
|
||||
document.title = browserTitle;
|
||||
document.querySelector("link[rel*='icon']").href = loginProLogo ? '/oss-rtss/logo/' + loginProLogo : '';
|
||||
store.commit('setCaseShow', caseShow);
|
||||
NProgress.start();
|
||||
const loginPath = getRouteInfo(to, response.data.markKey);
|
||||
const token = to.query.token;
|
||||
|
@ -94,7 +94,7 @@ const permission = {
|
||||
},
|
||||
actions: {
|
||||
// 生成其他权限路由
|
||||
GenerateRoutes({ commit }, data) {
|
||||
GenerateRoutes({ commit, rootState }, data) {
|
||||
return new Promise(resolve => {
|
||||
const { roles } = data;
|
||||
if (roles.includes(superAdmin) && !roles.includes(admin)) { // 只拥有超级管理员 没有管理员权限
|
||||
@ -110,6 +110,9 @@ const permission = {
|
||||
if (route.children && route.children.length == 0) {
|
||||
route.hidden = true;
|
||||
}
|
||||
if (route.path == '/case') {
|
||||
route.hidden = !rootState.projectConfig.caseShow;
|
||||
}
|
||||
});
|
||||
commit('SET_ROUTERS', accessedRouters);
|
||||
resolve();
|
||||
|
@ -3,7 +3,7 @@ const user = {
|
||||
homeProLogoWidth:0,
|
||||
loginProLogo:'',
|
||||
homeTitle:'',
|
||||
setCaseShow:true
|
||||
caseShow:true
|
||||
},
|
||||
mutations: {
|
||||
setHomeProLogoWidth: (state, homeProLogoWidth) => {
|
||||
|
@ -79,10 +79,10 @@ export default {
|
||||
this.loginProLogo = loginProLogo ? this.$store.state.user.ossUrl + '/logo/' + loginProLogo : '';
|
||||
document.title = browserTitle;
|
||||
document.querySelector("link[rel*='icon']").href = this.loginProLogo;
|
||||
this.$store.dispatch('projectConfig/setHomeProLogoWidth', homeProLogoWidth);
|
||||
this.$store.dispatch('projectConfig/setLoginProLogo', this.loginProLogo);
|
||||
this.$store.dispatch('projectConfig/setHomeTitle', homeTitle);
|
||||
this.$store.dispatch('projectConfig/setCaseShow', caseShow);
|
||||
this.$store.dispatch('setHomeProLogoWidth', homeProLogoWidth);
|
||||
this.$store.dispatch('setLoginProLogo', this.loginProLogo);
|
||||
this.$store.dispatch('setHomeTitle', homeTitle);
|
||||
this.$store.dispatch('setCaseShow', caseShow);
|
||||
setSessionStorage('project', this.project);
|
||||
// aboutSystem:"主体:北京玖琏科技有限公司 备案号:京ICP备2021039716号"
|
||||
// baseDevelopment
|
||||
|
Loading…
Reference in New Issue
Block a user