浏览代码

路径调整

wgl 4 年之前
父节点
当前提交
05ea0fb8d5

+ 5 - 0
src/components/Common.vue

@@ -107,6 +107,9 @@
 					var personPopedom = response ? response.personPopedom : '';
 					this.set_person_popedom(personPopedom);
 
+					var iconInfoList = response ? response.iconInfoList : '';
+					this.set_menu_list(iconInfoList);
+
 					this.asynCallBack();
 
 				}).catch(error => {
@@ -123,6 +126,7 @@
 				set_token: types.SET_TOKEN,
 				set_person_data: types.SET_PERSON_DATA,
 				set_person_popedom: types.SET_PERSON_POPEDOM,
+				set_menu_list: types.SET_MENI_LIST,
 			})
 		},
 		mounted() {},
@@ -132,6 +136,7 @@
 				token: 'token',
 				person_data: 'person_data',
 				person_popedom: 'person_popedom',
+				menu_list: 'menu_list'
 			})
 		}
 	}

+ 1 - 1
src/projects/business/main.js

@@ -52,7 +52,7 @@ router.beforeEach((to, from, next) => {
 		if (store.state.person_data) {
 			next();
 		} else {
-			window.location.href = '../home/#/login';
+			window.location.href = '../home/#/user/login';
 		}
 	} else {
 		next();

+ 2 - 2
src/projects/business/views/HouseKeeper/Admin/Center.vue

@@ -30,7 +30,7 @@
 						</a>
 					</li>
 					<li class="mui-table-view-cell">
-						<a href="../home/#/role?project=business&exchange=1" class="mui-navigate-right jump">
+						<a href="../home/#/user/role?project=business&exchange=1" class="mui-navigate-right jump">
 							<img src="~$project/assets/img/cicon17.png" width="18" /> 切换身份
 						</a>
 					</li>
@@ -76,7 +76,7 @@
 		created() {
 			//如果不存在则跳转到注册页面
 			if (!this.person_data) {
-				window.location.href = '../home/#/login'
+				window.location.href = '../home/#/user/login'
 			}
 		},
 		methods: {

+ 1 - 1
src/projects/business/views/HouseKeeper/Admin/Home.vue

@@ -196,7 +196,7 @@
 			},
 			//右上角点击事件
 			doRightLink() {
-				window.location.href = '../home/#/role?project=business&exchange=1'
+				window.location.href = '../home/#/user/role?project=business&exchange=1'
 			},
 			asynCallBack() {
 

+ 1 - 1
src/projects/business/views/HouseKeeper/Admin/Message.vue

@@ -83,7 +83,7 @@
 		created() {
 			//如果不存在则跳转到注册页面
 			if (!this.person_data) {
-				window.location.href = '../home/#/login'
+				window.location.href = '../home/#/user/login'
 			}
 		},
 		methods: {

+ 2 - 2
src/projects/business/views/Master/Center.vue

@@ -49,7 +49,7 @@
 						</a>
 					</li>
 					<li class="mui-table-view-cell">
-						<a href="../home/#/role?project=business&exchange=1" class="mui-navigate-right jump">
+						<a href="../home/#/user/role?project=business&exchange=1" class="mui-navigate-right jump">
 							<img src="~$project/assets/img/cicon17.png" width="18" /> 切换身份
 						</a>
 					</li>
@@ -95,7 +95,7 @@
 		created() {
 			//如果不存在则跳转到注册页面
 			if (!this.person_data) {
-				window.location.href = '../home/#/login'
+				window.location.href = '../home/#/user/login'
 			}
 		},
 		methods: {

+ 1 - 1
src/projects/business/views/Master/Home.vue

@@ -223,7 +223,7 @@
 		methods: {
 			//右上角点击事件
 			doRightLink() {
-				window.location.href = '../home/#/role?project=business&exchange=1'
+				window.location.href = '../home/#/user/role?project=business&exchange=1'
 			},
 			asynCallBack() {
 

+ 1 - 1
src/projects/business/views/Master/Message.vue

@@ -83,7 +83,7 @@
 		created() {
 			//如果不存在则跳转到注册页面
 			if (!this.person_data) {
-				window.location.href = '../home/#/login'
+				window.location.href = '../home/#/user/login'
 			}
 		},
 		methods: {

+ 33 - 25
src/projects/home/router/index.js

@@ -13,32 +13,40 @@ const routes = [
 			title: '首页',
 		}
 	},
-	//登录
-	{
-		path: '/login',
-		name: 'Login',
-		component: () => import('../views/User/Login.vue'),
-		meta: {
-			title: '登录',
-		}
-	},
-	//上传照片
-	{
-		path: '/uploadPhoto',
-		name: 'UploadPhoto',
-		component: () => import('../views/User/UploadPhoto.vue'),
-		meta: {
-			title: '上传照片',
-		}
-	},
-	//选择身份
+
+	//微信页面
 	{
-		path: '/role',
-		name: 'Role',
-		component: () => import('../views/User/Role.vue'),
-		meta: {
-			title: '选择身份',
-		}
+		path: '/user',
+		component: () => import('../views/Layout.vue'),
+		children: [
+			//登录
+			{
+				path: 'login',
+				name: 'UserLogin',
+				component: () => import('../views/User/Login.vue'),
+				meta: {
+					title: '登录',
+				}
+			},
+			//上传照片
+			{
+				path: 'uploadPhoto',
+				name: 'UserUploadPhoto',
+				component: () => import('../views/User/UploadPhoto.vue'),
+				meta: {
+					title: '上传照片',
+				}
+			},
+			//选择身份
+			{
+				path: 'role',
+				name: 'UserRole',
+				component: () => import('../views/User/Role.vue'),
+				meta: {
+					title: '选择身份',
+				}
+			},
+		]
 	},
 
 

+ 1 - 1
src/projects/home/views/User/Login.vue

@@ -187,7 +187,7 @@
 				openId: 'wx_openid',
 				token: 'token',
 				person_data: 'person_data',
-                person_popedom: 'person_popedom',
+				person_popedom: 'person_popedom',
 				vister_scene: 'vister_scene',
 			})
 		}

+ 2 - 0
src/store/getters.js

@@ -9,3 +9,5 @@ export const person_popedom = state => state.person_popedom
 export const vister_scene = state => state.vister_scene
 
 export const add_person_data = state => state.add_person_data
+
+export const menu_list = state => state.menu_list

+ 1 - 0
src/store/mutation-types.js

@@ -5,3 +5,4 @@ export const SET_PERSON_DATA = 'SET_PERSON_DATA'
 export const SET_PERSON_POPEDOM = 'SET_PERSON_POPEDOM'
 export const SET_VISTER_SCENE = 'SET_VISTER_SCENE'
 export const SET_ADD_PERSON_DATA = 'SET_ADD_PERSON_DATA'
+export const SET_MENI_LIST = 'SET_MENI_LIST'

+ 8 - 2
src/store/mutations.js

@@ -4,7 +4,8 @@ import {
 	setToken,
 	setPersonData,
 	setPersonPopedom,
-	setVisterScene
+	setVisterScene,
+	setMenuList
 } from '../utils/storage'
 
 var storage_prefix = process.env.VUE_APP_LOCAL_STORAGE_PREFIX;
@@ -43,7 +44,12 @@ const mutations = {
 	},
 	setControlAbnormalStatisticsEndTime(state, data) {
 		state.control_abnormal_statistics_endTime = data
-	}
+	},
+
+	[types.SET_MENI_LIST](state, data) {
+		setMenuList(storage_prefix, data)
+		state.menu_list = data
+	},
 }
 
 export default mutations

+ 3 - 1
src/store/state.js

@@ -3,7 +3,8 @@ import {
 	getToken,
 	getPersonData,
 	getPersonPopedom,
-	getVisterScene
+	getVisterScene,
+	getMenuList
 } from '../utils/storage'
 
 var storage_prefix = process.env.VUE_APP_LOCAL_STORAGE_PREFIX;
@@ -17,6 +18,7 @@ const state = {
 	add_person_data: '',
 	control_abnormal_statistics_startTime: '',
 	control_abnormal_statistics_endTime: '',
+	menu_list: getMenuList(storage_prefix),
 }
 
 export default state

+ 4 - 0
src/utils/storage.js

@@ -69,3 +69,7 @@ export const getPersonPopedom = (channel) => get(channel + '_person_popedom')
 export const setVisterScene = (channel, data) => set(channel + '_vister_scene', data)
 
 export const getVisterScene = (channel) => get(channel + '_vister_scene')
+
+export const setMenuList = (channel, data) => set(channel + '_menu_list', data)
+
+export const getMenuList = (channel) => get(channel + '_menu_list')