优化用户token验证
This commit is contained in:
parent
035e257852
commit
caf990dbff
|
@ -42,7 +42,8 @@ public class AuthController {
|
||||||
@ApiOperation(value = "验证token(不会返回密码)")
|
@ApiOperation(value = "验证token(不会返回密码)")
|
||||||
@GetMapping("/verify")
|
@GetMapping("/verify")
|
||||||
public R<UserVo> verify(@RequestHeader("token") String token) {
|
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 = "用户注册")
|
@ApiOperation(value = "用户注册")
|
||||||
|
|
Loading…
Reference in New Issue