优化用户token验证

This commit is contained in:
石皮幼鸟 2024-04-11 19:50:18 +08:00
parent 035e257852
commit caf990dbff
1 changed files with 2 additions and 1 deletions

View File

@ -42,7 +42,8 @@ public class AuthController {
@ApiOperation(value = "验证token不会返回密码")
@GetMapping("/verify")
public R<UserVo> verify(@RequestHeader("token") String token) {
return R.ok(authService.verify(token).toVo());
var user = authService.verify(token);
return user == null ? R.fail() : R.ok(user.toVo());
}
@ApiOperation(value = "用户注册")