666666666
666666666666666
6666666666666666666666666666666666666
666666666666666666666666666
11111111111111111
66666666666666666666666666
2020黑马大数据基础班42期 完整资料
2020黑马大数据基础班42期
@Autowired
private ConsumerTokenServices consumerTokenServices;
@GetMapping("oauth/test")
public String testOauth() {
return "oauth";
}
@GetMapping("user")
public Principal currentUser(Principal principal) {
return principal;
}
@DeleteMapping("signout")
public FebsResponse signout(HttpServletRequest request) throws FebsAuthException {
String authorization = request.getHeader("Authorization");
String token = StringUtils.replace(authorization, "bearer ", "");
FebsResponse febsResponse = new FebsResponse();
if (!consumerTokenServices.revokeToken(token)) {
throw new FebsAuthException("退出登录失败");
}
return febsResponse.message("退出登录成功");
} @Autowired
private ConsumerTokenServices consumerTokenServices;
@GetMapping("oauth/test")
public String testOauth() {
return "oauth";
}
@GetMapping("user")
public Principal currentUser(Principal principal) {
return principal;
}
@DeleteMapping("signout")
public FebsResponse signout(HttpServletRequest request) throws FebsAuthException {
String authorization = request.getHeader("Authorization");
String token = StringUtils.replace(authorization, "bearer ", "");
FebsResponse febsResponse = new FebsResponse();
if (!consumerTokenServices.revokeToken(token)) {
throw new FebsAuthException("退出登录失败");
}
return febsResponse.message("退出登录成功");
}
66666666666666666666
2020黑马大数据基础班42期 完整资料 [修改]