|
|
|
@@ -1,8 +1,6 @@ |
|
|
|
package com.iformall.controller; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.MallUserInfo; |
|
|
|
@@ -11,7 +9,6 @@ import com.iformall.service.MallUserInfoService; |
|
|
|
import com.iformall.service.MallUserRoleService; |
|
|
|
import com.iformall.shiro.UserSession; |
|
|
|
import com.iformall.shiro.UseriFormallToken; |
|
|
|
import com.iformall.utils.RedisUtils; |
|
|
|
import com.iformall.utils.TOTP; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
@@ -31,7 +28,6 @@ import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.servlet.RequestDispatcher; |
|
|
|
import javax.servlet.http.Cookie; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
@@ -144,7 +140,7 @@ public class WechatLoginController extends BaseController { |
|
|
|
} else { |
|
|
|
// 跳转登录页面 |
|
|
|
try { |
|
|
|
response.sendRedirect("https://" + host + "/#/login"); |
|
|
|
response.sendRedirect("https://" + host + "/#/login?errcode=您的微信未绑定"); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(e.getMessage()); |
|
|
|
} |
|
|
|
@@ -229,13 +225,11 @@ public class WechatLoginController extends BaseController { |
|
|
|
if(user != null) { |
|
|
|
user.setWebOpenId(accessToken.getOpenId()); |
|
|
|
mallUserInfoService.updateWebOpenId(user); |
|
|
|
// TODO 绑定成功 |
|
|
|
log.debug("https://" + host + "/#/layout"); |
|
|
|
response.sendRedirect("https://" + host + "/#/layout"); |
|
|
|
} else { |
|
|
|
// TODO 绑定失败 |
|
|
|
log.debug("https://" + host + "/#/layout"); |
|
|
|
response.sendRedirect("https://" + host + "/#/layout"); |
|
|
|
log.debug("https://" + host + "/#/layout?errcode=绑定失败"); |
|
|
|
response.sendRedirect("https://" + host + "/#/layout?errcode=绑定失败"); |
|
|
|
} |
|
|
|
} catch (WxErrorException e) { |
|
|
|
log.error(e.getMessage()); |
|
|
|
|