Commit 8816e72c authored by 水落(YangLei)'s avatar 水落(YangLei)

feat: 解决子路由不显示的问题

parent d6078aa2
export const RouterView = { render: h => h('router-view') };
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
user: undefined,
permissions: null, permissions: null,
roles: null, roles: null,
routesConfig: null, routesConfig: null,
}, },
//大量共享的方法 //大量共享的方法
getters: { getters: {
user: state => {
if (!state.user) {
try {
const user = '{}';
state.user = JSON.parse(user);
} catch (e) {
console.error(e);
}
}
return state.user;
},
permissions: state => { permissions: state => {
if (!state.permissions) { if (!state.permissions) {
try { try {
...@@ -53,10 +41,6 @@ export default { ...@@ -53,10 +41,6 @@ export default {
}, },
}, },
mutations: { mutations: {
setUser(state, user) {
state.user = user;
localStorage.setItem(process.env.VUE_APP_USER_KEY, JSON.stringify(user));
},
setPermissions(state, permissions) { setPermissions(state, permissions) {
state.permissions = permissions; state.permissions = permissions;
localStorage.setItem(process.env.VUE_APP_PERMISSIONS_KEY, JSON.stringify(permissions)); localStorage.setItem(process.env.VUE_APP_PERMISSIONS_KEY, JSON.stringify(permissions));
......
...@@ -22,13 +22,13 @@ export default { ...@@ -22,13 +22,13 @@ export default {
computed: { computed: {
...mapState('settingModule', ['isMobile', 'multiPage']), ...mapState('settingModule', ['isMobile', 'multiPage']),
desc() { desc() {
return this.page.desc; return this.page?.desc;
}, },
linkList() { linkList() {
return this.page.linkList; return this.page?.linkList;
}, },
extraImage() { extraImage() {
return this.page.extraImage; return this.page?.extraImage;
}, },
}, },
mounted() { mounted() {
......
import { PageTemplateView, TabsTemplateView } from '@/pages/frame/view/template'; import { PageTemplateView, TabsTemplateView } from '@/pages/frame/view/template';
import { RouterView } from '@/layout';
export const globalRoutes = [ export const globalRoutes = [
{ {
...@@ -74,6 +75,7 @@ const hasAuthorityRoutes = [ ...@@ -74,6 +75,7 @@ const hasAuthorityRoutes = [
{ {
path: 'organization', path: 'organization',
name: '组织管理', name: '组织管理',
component: RouterView,
children: [ children: [
{ {
path: 'job', path: 'job',
...@@ -103,6 +105,7 @@ const hasAuthorityRoutes = [ ...@@ -103,6 +105,7 @@ const hasAuthorityRoutes = [
{ {
path: 'parameter', path: 'parameter',
name: '参数管理', name: '参数管理',
component: RouterView,
children: [ children: [
{ {
path: 'business', path: 'business',
...@@ -119,6 +122,7 @@ const hasAuthorityRoutes = [ ...@@ -119,6 +122,7 @@ const hasAuthorityRoutes = [
{ {
path: 'log', path: 'log',
name: '日志管理', name: '日志管理',
component: RouterView,
children: [ children: [
{ {
path: 'login', path: 'login',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment