xiongchao преди 3 години
родител
ревизия
22b720997e
променени са 1 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 2 3
      platform-rest/src/main/java/com/platform/rest/controller/wechat/WechatController.java

+ 2 - 3
platform-rest/src/main/java/com/platform/rest/controller/wechat/WechatController.java

@@ -128,7 +128,7 @@ public class WechatController {
      * @return
      */
     @RequestMapping(value = "oauth", method = RequestMethod.GET)
-    public R oauth(HttpServletRequest request, HttpServletResponse response, @RequestParam String code) throws IOException {
+    public void oauth(HttpServletRequest request, HttpServletResponse response, @RequestParam String code) throws IOException {
         // 获取用户的openid和access_token
         JsonOauthAccessTokenResponse wechatResponse = WeChatConnectService.getOauthAccessToken(code);
         String openId = wechatResponse.getOpenid();
@@ -141,10 +141,9 @@ public class WechatController {
             searchUser.setUserId(userInfo.getUserId());
             sysUserService.modModelByPrimaryKey(searchUser);
         }
-        return R.success("https://rl.m.litian2017.com/#/pages/setting/wechat-oauth");
+        response.sendRedirect("https://rl.m.litian2017.com/#/pages/setting/wechat-oauth");
     }
 
-
 //    /**
 //     * 处理微信跳转过来的授权 授权成功后,保存openid到session,然后跳转到登录页面
 //     *