diff --git a/src/layout/index.js b/src/layout/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f664151f64e19d9fc74798f294684fde7ea27f52 --- /dev/null +++ b/src/layout/index.js @@ -0,0 +1 @@ +export const RouterView = { render: h => h('router-view') }; diff --git a/src/pages/frame/store/accountModule.js b/src/pages/frame/store/accountModule.js index 07249552e8dd6f6fe49ae4bd897647e5e0ab94cf..4319880919d2ba4d2444ba0310ea153e9f09bf09 100644 --- a/src/pages/frame/store/accountModule.js +++ b/src/pages/frame/store/accountModule.js @@ -1,24 +1,12 @@ export default { namespaced: true, state: { - user: undefined, permissions: null, roles: null, routesConfig: null, }, //大量共享的方法 getters: { - user: state => { - if (!state.user) { - try { - const user = '{}'; - state.user = JSON.parse(user); - } catch (e) { - console.error(e); - } - } - return state.user; - }, permissions: state => { if (!state.permissions) { try { @@ -53,10 +41,6 @@ export default { }, }, mutations: { - setUser(state, user) { - state.user = user; - localStorage.setItem(process.env.VUE_APP_USER_KEY, JSON.stringify(user)); - }, setPermissions(state, permissions) { state.permissions = permissions; localStorage.setItem(process.env.VUE_APP_PERMISSIONS_KEY, JSON.stringify(permissions)); diff --git a/src/pages/frame/view/template/PageTemplateView.vue b/src/pages/frame/view/template/PageTemplateView.vue index 524b0194147f2309a0f89046d2e7f97a1c7e4fbf..590b3906502cbe7a1165501e16c204b6c02b492a 100644 --- a/src/pages/frame/view/template/PageTemplateView.vue +++ b/src/pages/frame/view/template/PageTemplateView.vue @@ -22,13 +22,13 @@ export default { computed: { ...mapState('settingModule', ['isMobile', 'multiPage']), desc() { - return this.page.desc; + return this.page?.desc; }, linkList() { - return this.page.linkList; + return this.page?.linkList; }, extraImage() { - return this.page.extraImage; + return this.page?.extraImage; }, }, mounted() { diff --git a/src/router/config.js b/src/router/config.js index 47c85d40ee77afe6966b927d0c47666186e61ddd..2e676be6bd92ee37d223019061abafe86256329d 100644 --- a/src/router/config.js +++ b/src/router/config.js @@ -1,4 +1,5 @@ import { PageTemplateView, TabsTemplateView } from '@/pages/frame/view/template'; +import { RouterView } from '@/layout'; export const globalRoutes = [ { @@ -74,6 +75,7 @@ const hasAuthorityRoutes = [ { path: 'organization', name: '组织管理', + component: RouterView, children: [ { path: 'job', @@ -103,6 +105,7 @@ const hasAuthorityRoutes = [ { path: 'parameter', name: '参数管理', + component: RouterView, children: [ { path: 'business', @@ -119,6 +122,7 @@ const hasAuthorityRoutes = [ { path: 'log', name: '日志管理', + component: RouterView, children: [ { path: 'login',