|
@@ -64,7 +64,7 @@ public class WeiXinController extends BaseController {
|
|
|
public ModelAndView auth(@RequestParam("redirectUri") String redirectUri) {
|
|
public ModelAndView auth(@RequestParam("redirectUri") String redirectUri) {
|
|
|
|
|
|
|
|
return new ModelAndView("redirect:https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + PropertiesFileLoader.getProperties("weixinappid")
|
|
return new ModelAndView("redirect:https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + PropertiesFileLoader.getProperties("weixinappid")
|
|
|
- + "&redirect_uri=" + "http://xjw.izouma.com/wx/redirectLogin?redirectUri=" + redirectUri
|
|
|
|
|
|
|
+ + "&redirect_uri=" + PropertiesFileLoader.getProperties("base_domain") +"/wx/redirectLogin?redirectUri=" + redirectUri
|
|
|
+ "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect");
|
|
+ "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -74,7 +74,7 @@ public class WeiXinController extends BaseController {
|
|
|
public ModelAndView redirectLogin(HttpServletRequest request, HttpServletResponse response,
|
|
public ModelAndView redirectLogin(HttpServletRequest request, HttpServletResponse response,
|
|
|
@RequestParam(required = true, value = "code") String code, @RequestParam(required = false, value = "redirectUri") String redirectUri) {
|
|
@RequestParam(required = true, value = "code") String code, @RequestParam(required = false, value = "redirectUri") String redirectUri) {
|
|
|
|
|
|
|
|
- ModelAndView mav = new ModelAndView("redirect:http://xjw.izouma.com/#/" + redirectUri);
|
|
|
|
|
|
|
+ ModelAndView mav = new ModelAndView("redirect:"+ PropertiesFileLoader.getProperties("base_domain") +"/#/" + redirectUri);
|
|
|
final String APP_ID = PropertiesFileLoader.getProperties("weixinappid");
|
|
final String APP_ID = PropertiesFileLoader.getProperties("weixinappid");
|
|
|
final String APP_SECRET = PropertiesFileLoader.getProperties("weixinsecret");
|
|
final String APP_SECRET = PropertiesFileLoader.getProperties("weixinsecret");
|
|
|
try {
|
|
try {
|
|
@@ -124,7 +124,7 @@ public class WeiXinController extends BaseController {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
return new ModelAndView("redirect:https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + APP_ID + "&redirect_uri="
|
|
return new ModelAndView("redirect:https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + APP_ID + "&redirect_uri="
|
|
|
- + "http://xjw.izouma.com/wx/redirectLogin?redirectUri=" + redirectUri
|
|
|
|
|
|
|
+ + PropertiesFileLoader.getProperties("base_domain") +"/wx/redirectLogin?redirectUri=" + redirectUri
|
|
|
+ "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect");
|
|
+ "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect");
|
|
|
}
|
|
}
|
|
|
return mav;
|
|
return mav;
|
|
@@ -193,7 +193,7 @@ public class WeiXinController extends BaseController {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
return new ModelAndView("redirect:https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + APP_ID + "&redirect_uri="
|
|
return new ModelAndView("redirect:https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + APP_ID + "&redirect_uri="
|
|
|
- + "http://xjw.izouma.com/wx/Login" + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect");
|
|
|
|
|
|
|
+ + PropertiesFileLoader.getProperties("base_domain") +"/wx/Login" + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect");
|
|
|
}
|
|
}
|
|
|
return mav;
|
|
return mav;
|
|
|
}
|
|
}
|