Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly

This commit is contained in:
joylink_cuiweidong 2022-10-12 16:43:29 +08:00
commit fae2e31fbc
4 changed files with 11 additions and 7 deletions

View File

@ -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;

View File

@ -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();

View File

@ -3,7 +3,7 @@ const user = {
homeProLogoWidth:0,
loginProLogo:'',
homeTitle:'',
setCaseShow:true
caseShow:true
},
mutations: {
setHomeProLogoWidth: (state, homeProLogoWidth) => {

View File

@ -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:" ICP2021039716"
// baseDevelopment