Quellcode durchsuchen

路由跳转修复bug

maotao vor 5 Monaten
Ursprung
Commit
7718dd95b3
3 geänderte Dateien mit 41 neuen und 14 gelöschten Zeilen
  1. 24 11
      interceptor/routeInterceptor.js
  2. 8 0
      pages/repair/rapidRepNext.vue
  3. 9 3
      share/useLoginSuccess.js

+ 24 - 11
interceptor/routeInterceptor.js

@@ -17,18 +17,31 @@ let repaireRouterList = [
17 17
         // 调用前拦截
18 18
         const url = e.url.split('?')[0];
19 19
         // 报修人不可以访问除了登录页,绑定工号页,报修入口页的其他页面
20
-        if (!repaireRouterList.includes(url) && !url.includes("repair") && loginUserStore.loginUser.user && loginUserStore.loginUser.user
21
-          .engineer !== 1) {
22
-						if(loginType==1){
23
-							uni.reLaunch({
24
-							  url: "/pages/repairEntrance/repairEntrance"
25
-							})
26
-						}else if(loginType==2){
27
-							uni.reLaunch({
28
-							  url: "/pages/repair/home"
29
-							})
20
+        if (!repaireRouterList.includes(url) && !url.includes("repair") && loginUserStore.loginUser.user) {
21
+						if(loginUserStore.loginUser.user.engineer == 0){
22
+							if(loginType==1){
23
+								uni.reLaunch({
24
+								  url: "/pages/repairEntrance/repairEntrance"
25
+								})
26
+							}else if(loginType==2){
27
+								uni.reLaunch({
28
+								  url: "/pages/repair/home"
29
+								})
30
+							}
31
+							return false
32
+						}else{
33
+							if(loginType==1){
34
+								uni.reLaunch({
35
+								  url: "/pages/incidentList/incidentList"
36
+								})
37
+							}else if(loginType==2){
38
+								uni.reLaunch({
39
+								  url: "/pages/repair/home"
40
+								})
41
+							}
42
+							return false
30 43
 						}
31
-          return false
44
+						
32 45
         }
33 46
         return true
34 47
       },

+ 8 - 0
pages/repair/rapidRepNext.vue

@@ -264,6 +264,14 @@
264 264
     dataInfo.tabActiveValue = tabValue;
265 265
     isSubmit.value = false;
266 266
     reset();
267
+		if(tabValue=='doing'){
268
+			let user = loginUserStore.loginUser.user
269
+			if(user){
270
+				dataInfo.department = user.dept.id
271
+			}
272
+		}else{
273
+			dataInfo.department = ''
274
+		}
267 275
     dataInfo.category = dataInfo.incidentData.category || {};
268 276
     dataInfo.synergetic = dataInfo.incidentData.synergetic || [];
269 277
 		newProvideBackupMachine.value = dataInfo.incidentData.provideBackupMachine

+ 9 - 3
share/useLoginSuccess.js

@@ -11,9 +11,15 @@ export function useLoginSuccess() {
11 11
 		let loginType = uni.getStorageSync('loginType'); //1:处理 2:报修
12 12
     // 判断用户标识是否为处理人
13 13
     if (user.user.engineer === 1) {
14
-      uni.reLaunch({
15
-        url: '/pages/incidentList/incidentList'
16
-      })
14
+			if(loginType==1){
15
+				uni.reLaunch({
16
+				  url: "/pages/incidentList/incidentList"
17
+				})
18
+			}else if(loginType==2){
19
+				uni.reLaunch({
20
+				  url: "/pages/repair/home"
21
+				})
22
+			}
17 23
     } else {
18 24
 			if(loginType==1){
19 25
 				uni.reLaunch({