|
|
@@ -10,40 +10,45 @@
|
|
10
|
10
|
</head>
|
|
11
|
11
|
|
|
12
|
12
|
<body>
|
|
13
|
|
- <script src="layui/layui.js"></script>
|
|
|
13
|
+ <script src="layui/layui.js"></script>
|
|
14
|
14
|
<script src="js/zepto.js"></script>
|
|
15
|
|
- <script src="Script/Common/huayi.config.js"></script>
|
|
16
|
|
- <script src="Script/Common/huayi.http.js"></script>
|
|
|
15
|
+ <script src="Script/Common/huayi.config.js"></script>
|
|
|
16
|
+ <script src="Script/Common/huayi.http.js"></script>
|
|
17
|
17
|
<script type="text/javascript">
|
|
18
|
|
- var openid = helper.cookies.get("openid");
|
|
19
|
|
- var code = helper.request.queryString("code");
|
|
20
|
|
- var menucode = helper.request.queryString("menucode");
|
|
21
|
|
- if (!openid) {
|
|
22
|
|
- $.ajax({
|
|
23
|
|
- type: "get",
|
|
24
|
|
- url: huayi.config.callcenter_url + 'WxLogin/GetOpenId',
|
|
25
|
|
- data: { code: code },
|
|
26
|
|
- dataType: 'json',
|
|
27
|
|
- success: function (result) {
|
|
28
|
|
- if (result.state.toLowerCase() == "success") {
|
|
29
|
|
- helper.cookies.set("openid", result.data, 7);
|
|
30
|
|
- gourl()
|
|
31
|
|
- }
|
|
32
|
|
- }
|
|
33
|
|
- });
|
|
34
|
|
- }
|
|
35
|
|
- else {
|
|
36
|
|
- gourl()
|
|
37
|
|
- }
|
|
38
|
|
-
|
|
39
|
|
- function gourl()
|
|
40
|
|
- {
|
|
41
|
|
- switch (menucode)
|
|
42
|
|
- {
|
|
43
|
|
- case "GDZX": window.location.replace("html/home.html"); break;
|
|
44
|
|
- default: window.location.replace("html/error.html"); break;
|
|
45
|
|
- }
|
|
46
|
|
- }
|
|
|
18
|
+ var openid = helper.cookies.get("openid");
|
|
|
19
|
+// var openid = 'obwtK6JT-bTCeSbtqu4lkw4lIz0o'
|
|
|
20
|
+// helper.cookies.set("openid", openid);
|
|
|
21
|
+ var code = helper.request.queryString("code");
|
|
|
22
|
+ var menucode = helper.request.queryString("menucode");
|
|
|
23
|
+ if(!openid) {
|
|
|
24
|
+ $.ajax({
|
|
|
25
|
+ type: "get",
|
|
|
26
|
+ url: huayi.config.callcenter_url + 'WxLogin/GetOpenId',
|
|
|
27
|
+ data: {
|
|
|
28
|
+ code: code,RedirectUrl:window.location.href
|
|
|
29
|
+ },
|
|
|
30
|
+ dataType: 'json',
|
|
|
31
|
+ success: function(result) {
|
|
|
32
|
+ if(result.state.toLowerCase() == "success") {
|
|
|
33
|
+ helper.cookies.set("openid", result.data, 7);
|
|
|
34
|
+ gourl()
|
|
|
35
|
+ }
|
|
|
36
|
+ }
|
|
|
37
|
+ });
|
|
|
38
|
+ } else {
|
|
|
39
|
+ gourl()
|
|
|
40
|
+ }
|
|
|
41
|
+
|
|
|
42
|
+ function gourl() {
|
|
|
43
|
+ switch(menucode) {
|
|
|
44
|
+ case "GDZX":
|
|
|
45
|
+ window.location.replace("html/home.html");
|
|
|
46
|
+ break;
|
|
|
47
|
+ default:
|
|
|
48
|
+ window.location.replace("html/error.html");
|
|
|
49
|
+ break;
|
|
|
50
|
+ }
|
|
|
51
|
+ }
|
|
47
|
52
|
</script>
|
|
48
|
53
|
</body>
|
|
49
|
54
|
|