Commit ed54b020 authored by 陈浩玮's avatar 陈浩玮

Merge branch 'feature/shuiluo' into 'master'

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

See merge request product/kim3-web-vue/starter-web-vue!27
parents 787c4982 8816e72c
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