登录返回信息

This commit is contained in:
小久哥
2022-05-27 14:19:52 +08:00
parent 67eb497114
commit 1273f011b4
2 changed files with 5 additions and 5 deletions
@@ -30,11 +30,9 @@ import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpService;
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.security.authentication.AuthenticationManager;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.*;
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.security.core.util.SecurityFrameworkUtils.getLoginUserId;
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 = "管理后台 - 认证")
@RestController
@@ -115,7 +112,7 @@ public class AuthController {
.platform("wxcp")
.build();
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);
}
@@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth;
import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@@ -17,4 +19,5 @@ public class AuthLoginRespVO {
@ApiModelProperty(value = "token", required = true, example = "zsw")
private String token;
private AdminUserDO user;
}