|
|
@ -30,11 +30,9 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import me.chanjar.weixin.common.error.WxErrorException; |
|
|
|
import me.chanjar.weixin.common.error.WxErrorException; |
|
|
|
import me.chanjar.weixin.cp.api.WxCpService; |
|
|
|
import me.chanjar.weixin.cp.api.WxCpService; |
|
|
|
import me.chanjar.weixin.cp.bean.WxCpMaJsCode2SessionResult; |
|
|
|
import me.chanjar.weixin.cp.bean.WxCpMaJsCode2SessionResult; |
|
|
|
import org.apache.tomcat.util.http.RequestUtil; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
|
|
|
import org.springframework.security.authentication.AuthenticationManager; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.ServletRequestUtils; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
@ -46,7 +44,6 @@ import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getCli |
|
|
|
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getUserAgent; |
|
|
|
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getUserAgent; |
|
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
|
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
|
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserRoleIds; |
|
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserRoleIds; |
|
|
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.CP_USER_NOT_EXISTS; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Api(tags = "管理后台 - 认证") |
|
|
|
@Api(tags = "管理后台 - 认证") |
|
|
|
@RestController |
|
|
|
@RestController |
|
|
@ -115,7 +112,7 @@ public class AuthController { |
|
|
|
.platform("wxcp") |
|
|
|
.platform("wxcp") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
String token = authService.login(login, getClientIP(), getUserAgent()); |
|
|
|
String token = authService.login(login, getClientIP(), getUserAgent()); |
|
|
|
AuthLoginRespVO vo = AuthLoginRespVO.builder().token(token).build(); |
|
|
|
AuthLoginRespVO vo = AuthLoginRespVO.builder().token(token).user(user).build(); |
|
|
|
return CommonResult.success(vo); |
|
|
|
return CommonResult.success(vo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|