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

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

parent d6078aa2
export const RouterView = { render: h => h('router-view') };
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));
......
......@@ -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() {
......
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',
......
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