maotao 1 mēnesi atpakaļ
vecāks
revīzija
07402cbcbf
2 mainītis faili ar 49 papildinājumiem un 7 dzēšanām
  1. 30 2
      pages/homePage/homePage.vue
  2. 19 5
      share/useWechatAuth.js

+ 30 - 2
pages/homePage/homePage.vue

@@ -54,7 +54,21 @@
54 54
 			        confirmColor: defaultColor,
55 55
 			        confirmText: '取消',
56 56
 			      });
57
-			    } else if (res.status == 555) {
57
+			    } else if (res.status == 508){
58
+						uni.showModal({
59
+							title: '提示',
60
+							content: res.remarks,
61
+							showCancel: false,
62
+							confirmColor: '#49b856',
63
+							success: function(res1) {
64
+								if (res1.confirm) {
65
+									console.log('用户点击确定');
66
+								} else if (res1.cancel) {
67
+									console.log('用户点击取消');
68
+								}
69
+							}
70
+						});
71
+					}else if (res.status == 555) {
58 72
 			      uni.reLaunch({
59 73
 			        url: `/pages/initBind/initBind?wechat=${res.wechat}`
60 74
 			      })
@@ -92,7 +106,21 @@
92 106
 			        confirmColor: defaultColor,
93 107
 			        confirmText: '取消',
94 108
 			      });
95
-			    } else if (res.status == 555) {
109
+			    } else if (res.status == 508){
110
+						uni.showModal({
111
+							title: '提示',
112
+							content: res.remarks,
113
+							showCancel: false,
114
+							confirmColor: '#49b856',
115
+							success: function(res1) {
116
+								if (res1.confirm) {
117
+									console.log('用户点击确定');
118
+								} else if (res1.cancel) {
119
+									console.log('用户点击取消');
120
+								}
121
+							}
122
+						});
123
+					}else if (res.status == 555) {
96 124
 			      uni.reLaunch({
97 125
 			        url: `/pages/initBind/initBind?wechat=${res.wechat}`
98 126
 			      })

+ 19 - 5
share/useWechatAuth.js

@@ -14,10 +14,8 @@ export function useWechatAuth() {
14 14
       redirectUrl: location.origin + location.pathname
15 15
     }).then(res => {
16 16
       uni.hideLoading();
17
-      if (res.url) {
18
-        window.location.href = res.url;
19
-      } else {
20
-        loginSuccess(res.user);
17
+			if (res.state == "200"){
18
+				loginSuccess(res.user);
21 19
 				transform(res.user);
22 20
 				api_systemConfiguration({
23 21
 					idx: 0,
@@ -33,7 +31,23 @@ export function useWechatAuth() {
33 31
 				api_getDictionary(postData).then((data) => {
34 32
 					uni.setStorageSync('groupData',JSON.stringify(data))
35 33
 				});
36
-      }
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){
49
+				window.location.href = res.url;
50
+			}
37 51
     });
38 52
   }
39 53