zhengkaixin 2 years ago
parent
commit
6f38d8f291
2 changed files with 19 additions and 6 deletions
  1. 18 5
      src/components/Common.vue
  2. 1 1
      src/projects/business/views-home/User/Login.vue

+ 18 - 5
src/components/Common.vue

@@ -41,6 +41,10 @@
 				require: false,
 				default: true,
 			},
+			projectCheckLogin: {
+				require: false,
+				default: false,
+			},
 			doLoading: {
 				require: false,
 				default: false,
@@ -138,7 +142,7 @@
 
 					var commonIconInfoList = response ? response.commonIconInfoList : '';
 					this.set_common_menu_list(commonIconInfoList);
-
+					
 					//获取所有功能列表
 					if (token) {
 						this.getAuthFunList();
@@ -161,7 +165,7 @@
 						var allIconRoute = response.allIconRoute;
 						this.set_auth_fun_list(allIconRoute);
 
-						this.asynCallBack();
+						this.asynCallBack(true);
 					} else {
 						mui.toast('未返回allIcon');
 					}
@@ -171,10 +175,19 @@
 					mui.toast(error);
 				})
 			},
-		
+			//判断权限然后进行跳转
+			projectExchange() {
+				
+				//如果不想跳转,还可以传参exchange,一般用于home注册切换等功能
+				if (this.projectCheckLogin) {
+					window.location.href = '../#/master';
+				}
+			},
 			//异步回调父组件的方法
-			asynCallBack() {
-				//this.projectExchange();
+			asynCallBack(bl) {
+				if(bl){
+					this.projectExchange();
+				}
 				this.$emit('asynCallBack');
 			},
 			...mapMutations({

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

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<common @asynCallBack="asynCallBack" :projectCheck="false"></common>
+		<common @asynCallBack="asynCallBack" :projectCheckLogin="true" ></common>
 		<top-header :pageTitle="pageTitle" :leftShow="false"></top-header>
 
 		<div class="mui-content">