|
|
|
@@ -21,6 +21,7 @@ import me.chanjar.weixin.common.error.WxErrorException; |
|
|
|
import me.chanjar.weixin.mp.api.WxMpService; |
|
|
|
import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; |
|
|
|
import me.chanjar.weixin.mp.bean.result.WxMpUser; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
import org.apache.shiro.subject.Subject; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -231,4 +232,22 @@ public class WechatLoginController extends BaseController { |
|
|
|
log.error(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "微信第三方登录解绑", notes = "请配置此callback到网页redirect_uri") |
|
|
|
@GetMapping("cleanWebOpenId") |
|
|
|
public ResultData cleanWebOpenId(@ModelAttribute MallUserInfo userInfo) { |
|
|
|
log.debug("[" + getIpAddr() + "] WechatLoginController::cleanWebOpenId"); |
|
|
|
MallUserInfo user = getUser(); |
|
|
|
if(userInfo == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(userInfo.getTenantId())) { |
|
|
|
userInfo.setTenantId(user.getTenantId()); |
|
|
|
} |
|
|
|
if(userInfo.getId() == null && userInfo.getUsername() == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
mallUserInfoService.cleanWebOpenId(userInfo); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
} |