Browse Source

登录返回信息

zyh
小久哥 3 years ago
parent
commit
1273f011b4
  1. 7
      yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java
  2. 3
      yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthLoginRespVO.java

7
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java

@ -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);
}

3
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthLoginRespVO.java

@ -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;
}

Loading…
Cancel
Save