|
|
@@ -2,6 +2,7 @@ package com.sharemao.web.wx.ctrl;
|
|
2
|
2
|
|
|
3
|
3
|
import java.net.URLEncoder;
|
|
4
|
4
|
import java.util.Arrays;
|
|
|
5
|
+import java.util.HashMap;
|
|
5
|
6
|
import java.util.Map;
|
|
6
|
7
|
|
|
7
|
8
|
import javax.servlet.http.HttpSession;
|
|
|
@@ -62,7 +63,11 @@ public class AuthCtrl
|
|
62
|
63
|
String url="http://gzxc.yunjia99.cn/user/indexForOld.do?&openid=" + openid+"&sn="+cursn;
|
|
63
|
64
|
if (GzhUtil.isEmpty(cursn)){
|
|
64
|
65
|
url="http://gzxc.yunjia99.cn/user/indexForOld.do?&openid=" + openid;
|
|
65
|
|
- }
|
|
|
66
|
+ } /*else {
|
|
|
67
|
+ if (getDevtype(cursn)==16){
|
|
|
68
|
+ url="http://dy.yunjia99.cn/user/indexForOld.do?&openid=" + openid+"&sn="+cursn;
|
|
|
69
|
+ }
|
|
|
70
|
+ }*/
|
|
66
|
71
|
url = URLEncoder.encode(url);
|
|
67
|
72
|
log.info("url="+url);
|
|
68
|
73
|
String path = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb06cf14f96dd7149&redirect_uri=" + url + "&response_type=code&scope=snsapi_base&state=123#wechat_redirect";
|
|
|
@@ -109,6 +114,27 @@ public class AuthCtrl
|
|
109
|
114
|
// return new TextView("/activation.jsp");
|
|
110
|
115
|
// }
|
|
111
|
116
|
}
|
|
|
117
|
+
|
|
|
118
|
+ /*private int getDevtype(String cursn){
|
|
|
119
|
+ Map<String, String> para = new HashMap<>();
|
|
|
120
|
+ para.put("devid", cursn);
|
|
|
121
|
+ String devTypeResult = GzhUtil.sendPost(Constants.m3IntAddr + "/device/getDevType.do", para);
|
|
|
122
|
+ try {
|
|
|
123
|
+ if(!Tools.isEmpty(devTypeResult))
|
|
|
124
|
+ {
|
|
|
125
|
+ JSONObject devTypeJson = JSONObject.parseObject(devTypeResult);
|
|
|
126
|
+ int resCode2 = devTypeJson.getIntValue("code");
|
|
|
127
|
+ if(resCode2 == 0){
|
|
|
128
|
+ JSONObject devTypeDataJson = devTypeJson.getJSONObject("data");
|
|
|
129
|
+ JSONObject devtypeJo = devTypeDataJson.getJSONObject("devtype");
|
|
|
130
|
+ return devtypeJo.getIntValue("id");
|
|
|
131
|
+ }
|
|
|
132
|
+ }
|
|
|
133
|
+ } catch (Exception e) {
|
|
|
134
|
+ log.info(Tools.getExceptionMessage( e));
|
|
|
135
|
+ }
|
|
|
136
|
+ return 0;
|
|
|
137
|
+ }*/
|
|
112
|
138
|
|
|
113
|
139
|
/**
|
|
114
|
140
|
* 用户登陆界面,登陆后将微信号自动绑定到用户账号
|