Explorar el Código

系统安全开发

maotao hace 1 mes
padre
commit
51097c7d27
Se han modificado 2 ficheros con 23 adiciones y 48 borrados
  1. 20 16
      pages/incidentList/incidentList.vue
  2. 3 32
      share/useWechatAuth.js

+ 20 - 16
pages/incidentList/incidentList.vue

@@ -452,23 +452,27 @@
452 452
 				dataInfo.evtFilter.deptValue = hospital.id
453 453
 			// }
454 454
 		}
455
-
456
-    for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
457
-      if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
458
-        let currentMenu = loginUserStore.loginUser.menu[i].childrens;
459
-        for (let j = 0; j < currentMenu.length; j++) {
460
-          if (currentMenu[j].link == "assign") {
461
-            assignFlag.value = true;
462
-          }
463
-          if (currentMenu[j].link == "receive") {
464
-            qiangdan.value = true
465
-          }
466
-					if (currentMenu[j].link == "strideLook") {
467
-					  showDept.value = true
455
+		
456
+		let menu = JSON.parse(uni.getStorageSync("menuList")) || []; //菜单
457
+		menu.forEach((e) => {
458
+		  if (e.title=='故障管理') {
459
+		    e.childrens.forEach((el) => {
460
+					if(el.link=='incidentManagement'){
461
+						el.childrens.forEach(item =>{
462
+							if (item.link == "assign") {
463
+							  assignFlag.value = true;
464
+							}
465
+							if (item.link == "receive") {
466
+							  qiangdan.value = true
467
+							}
468
+							if (item.link == "strideLook") {
469
+							  showDept.value = true
470
+							}
471
+						})
468 472
 					}
469
-        }
470
-      }
471
-    }
473
+		    });
474
+		  }
475
+		});
472 476
     getTabs();
473 477
   }
474 478
   onLoad((option) => {

+ 3 - 32
share/useWechatAuth.js

@@ -14,39 +14,10 @@ export function useWechatAuth() {
14 14
       redirectUrl: location.origin + location.pathname
15 15
     }).then(res => {
16 16
       uni.hideLoading();
17
-			if (res.state == "200"){
18
-				loginSuccess(res.user);
19
-				transform(res.user);
20
-				api_systemConfiguration({
21
-					idx: 0,
22
-					sum: 9999,
23
-				}).then(res2=>{
24
-					uni.setStorageSync('sysData',JSON.stringify(res2.list))
25
-				})
26
-				
27
-				let postData = {
28
-					"key": 'usertype',
29
-					"type": "list",
30
-				};
31
-				api_getDictionary(postData).then((data) => {
32
-					uni.setStorageSync('groupData',JSON.stringify(data))
33
-				});
34
-			} else if (res.state == "501"){
35
-				uni.showModal({
36
-				  title: '提示',
37
-				  content: res.remarks,
38
-				  showCancel: false,
39
-				  confirmColor: '#49b856',
40
-				  success: function(res1) {
41
-				    if (res1.confirm) {
42
-				      console.log('用户点击确定');
43
-				    } else if (res1.cancel) {
44
-				      console.log('用户点击取消');
45
-				    }
46
-				  }
47
-				});
48
-			}else if (res.url){
17
+      if (res.url) {
49 18
 				window.location.href = res.url;
19
+			} else {
20
+				loginSuccess(res.user);
50 21
 			}
51 22
     });
52 23
   }