Просмотр исходного кода

修改政务服务网对接的bug

zhoufan лет назад: 7
Родитель
Сommit
e065a7b389
1 измененных файлов с 18 добавлено и 20 удалено
  1. 18 20
      WebChat/appindex.html

+ 18 - 20
WebChat/appindex.html

@@ -20,29 +20,27 @@
20 20
         var usercode = helper.request.queryString("usercode");
21 21
         var signcode = helper.request.queryString("signcode");
22 22
         var menucode = helper.request.queryString("menucode");
23
-        if (!openid) {
24
-            if (usercode && signcode) {
25
-                $.ajax({
26
-                    type: "get",
27
-                    url: huayi.config.callcenter_url + 'WxLogin/GetZWWUser',
28
-                    async: false,
29
-                    data: { usercode: usercode, signcode: signcode },
30
-                    dataType: 'json',
31
-                    success: function (data) {
32
-                        if (data.state.toLowerCase() == "success") {
33
-                            helper.cookies.set("openid", data.data, 7);
23
+        if (openid && openid.indexOf(usercode) != -1) {
24
+            gourl();
25
+        }
26
+        else if (usercode && signcode) {
27
+            $.ajax({
28
+                type: "get",
29
+                url: huayi.config.callcenter_url + 'WxLogin/GetZWWUser',
30
+                async: false,
31
+                data: { usercode: usercode, signcode: signcode },
32
+                dataType: 'json',
33
+                success: function (data) {
34
+                    if (data.state.toLowerCase() == "success") {
35
+                        helper.cookies.set("openid", data.data, 7);
34 36
 
35
-                            if (!helper.cookies.get("openid")) {
36
-                                window.location.replace("html/error.html?r=" + Math.random());
37
-                            }
38
-                            gourl();
37
+                        if (!helper.cookies.get("openid")) {
38
+                            window.location.replace("html/error.html?r=" + Math.random());
39 39
                         }
40
+                        gourl();
40 41
                     }
41
-                });
42
-            }
43
-        }
44
-        else {
45
-            gourl();
42
+                }
43
+            });
46 44
         }
47 45
 
48 46
         function gourl() {