新增:其他客户端获取登录用户信息(post方式)

This commit is contained in:
gxwebsoft
2023-10-25 19:08:21 +08:00
parent 84054c853c
commit 3ac2255b9f
2 changed files with 14 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ import com.gxwebsoft.common.system.mapper.CompanyMapper;
import com.gxwebsoft.common.system.param.LoginParam;
import com.gxwebsoft.common.system.param.SmsCaptchaParam;
import com.gxwebsoft.common.system.param.UpdatePasswordParam;
import com.gxwebsoft.common.system.param.UserParam;
import com.gxwebsoft.common.system.result.CaptchaResult;
import com.gxwebsoft.common.system.result.LoginResult;
import com.gxwebsoft.common.system.service.*;
@@ -359,6 +360,17 @@ public class MainController extends BaseController {
}
}
@ApiOperation("获取登录用户信息Authorities")
@PostMapping("/auth/user")
public ApiResult<User> userInfo(@RequestBody UserParam param) {
// 登录账号|手机号码|邮箱登录
User user = userService.getByUsername(param.getUsername(), param.getTenantId());
if (user != null) {
return success(user);
}
return fail("用户不存在", null);
}
@ApiOperation("免密登录")
@GetMapping("/token/{userId}/{accessKey}")
public ApiResult<LoginResult> getToken(@PathVariable("userId") Integer userId, @PathVariable("accessKey") String accessKey) {

View File

@@ -1,9 +1,9 @@
# 端口
server:
port: 9090
port: 9099
# socketIo
socketio:
port: 9191
port: 9199
# 多环境配置
spring:
profiles: