|
@@ -34,7 +34,7 @@ public class WebBridgeController extends ApiController {
|
|
}
|
|
}
|
|
|
|
|
|
public void reportExternalLink() {
|
|
public void reportExternalLink() {
|
|
- this.process(WEB_BASR_URL_4+"/reportListOuter?institution_id=" + this.getPara("institution_id") + "&type=" + this.getPara("type")+ "&code=" + this.getPara("code"));
|
|
|
|
|
|
+ this.process2(WEB_BASR_URL_4+"/reportListOuter?institution_id=" + this.getPara("institution_id") + "&type=" + this.getPara("type")+ "&code=" + this.getPara("code"));
|
|
}
|
|
}
|
|
|
|
|
|
public void test4() {
|
|
public void test4() {
|
|
@@ -122,22 +122,16 @@ public class WebBridgeController extends ApiController {
|
|
|
|
|
|
public void process2(String toUrl) {
|
|
public void process2(String toUrl) {
|
|
try {
|
|
try {
|
|
-// System.out.println(toUrl);
|
|
|
|
-// System.out.println(getRequest().getRequestURL().toString());
|
|
|
|
- renderText(getRequest().getQueryString());
|
|
|
|
- return;
|
|
|
|
-// Object sessionObj = null;
|
|
|
|
-// WeixinService wService = ServiceFactory.getService(WeixinService.class);
|
|
|
|
-// if (sessionObj == null) {
|
|
|
|
-// String code = this.getPara("code");
|
|
|
|
-// if (code == null) {
|
|
|
|
-// System.out.println(ApiConfigKit.getApiConfig().getAppId());
|
|
|
|
-// System.out.println(getRequest().getRequestURL().toString());
|
|
|
|
-//// String uidStr = toUrl.contains("?") ? "&appId=" : "?appId=";
|
|
|
|
-// String url = wService.getCodeUrl(ApiConfigKit.getApiConfig().getAppId(), getRequest().getRequestURL().toString());
|
|
|
|
-// this.redirect(url);
|
|
|
|
|
|
+ Object sessionObj = null;
|
|
|
|
+ WeixinService wService = ServiceFactory.getService(WeixinService.class);
|
|
|
|
+ if (sessionObj == null) {
|
|
|
|
+ String code = this.getPara("code");
|
|
|
|
+ if (code == null) {
|
|
|
|
+ String paramString = getRequest().getQueryString()==null?"":"?"+getRequest().getQueryString();
|
|
|
|
+ String url = wService.getCodeUrl(ApiConfigKit.getApiConfig().getAppId(), getRequest().getRequestURL().toString() + paramString);
|
|
|
|
+ this.redirect(url);
|
|
// return;
|
|
// return;
|
|
-// }
|
|
|
|
|
|
+ }
|
|
// System.out.println(ApiConfigKit.getApiConfig().getAppId());
|
|
// System.out.println(ApiConfigKit.getApiConfig().getAppId());
|
|
// SnsAccessToken snsAccessToken = wService.getWebAccessToken(ApiConfigKit.getApiConfig().getAppId(), ApiConfigKit.getApiConfig().getAppSecret(), code);
|
|
// SnsAccessToken snsAccessToken = wService.getWebAccessToken(ApiConfigKit.getApiConfig().getAppId(), ApiConfigKit.getApiConfig().getAppSecret(), code);
|
|
//
|
|
//
|
|
@@ -153,27 +147,7 @@ public class WebBridgeController extends ApiController {
|
|
// this.getRequest().getSession().setAttribute("pwpSessionObjtest9", user);
|
|
// this.getRequest().getSession().setAttribute("pwpSessionObjtest9", user);
|
|
// String uidStr = toUrl.contains("?") ? "&openid=" : "?openid=";
|
|
// String uidStr = toUrl.contains("?") ? "&openid=" : "?openid=";
|
|
// this.redirect(toUrl + uidStr + snsAccessToken.getOpenid());
|
|
// this.redirect(toUrl + uidStr + snsAccessToken.getOpenid());
|
|
-// } else {
|
|
|
|
-// UserService uService = ServiceFactory.getService(UserService.class);
|
|
|
|
-// UserWechat userWechats = (UserWechat) sessionObj;
|
|
|
|
-// UserWechat users = UserWechat.dao.findById(userWechats.getId());
|
|
|
|
-// String uidStr = toUrl.contains("?") ? "&openid=" : "?openid=";
|
|
|
|
-// if (users == null) {
|
|
|
|
-// userWechats = uService.createWxUserByAppid(userWechats.getWxOpenid(), ApiConfigKit.getApiConfig().getAppId());
|
|
|
|
-// }
|
|
|
|
-// UserWechat users2 = UserWechat.dao.findFirst("select * from user_wechat where wx_openid=?",userWechats.getWxOpenid());
|
|
|
|
-// if (users2 != null && users2.getWxIcon().isEmpty()) {
|
|
|
|
-//// uService.getUserInfo(userWechats.getWxOpenid());
|
|
|
|
-//// wService.getWebWeixinUserInfo(snsAccessToken.getAccessToken(), snsAccessToken.getOpenid());
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// this.getRequest().getSession().setAttribute("pwpSessionObjtest9", users2);
|
|
|
|
-//
|
|
|
|
-// this.redirect(toUrl + uidStr + userWechats.getWxOpenid());
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
|
|
+ }
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
// nothing
|
|
// nothing
|
|
// this.redirect("http://www.pacsonline.cn");
|
|
// this.redirect("http://www.pacsonline.cn");
|