feat(jwt): implement JWT-based authentication system
This commit is contained in:
@@ -17,9 +17,9 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class TestController {
|
||||
|
||||
@PostMapping("/test")
|
||||
@PostMapping("/admin/test")
|
||||
@ApiOperationLog(description = "测试接口")
|
||||
public ResponseEntity<String> test(@RequestBody @Validated User user, BindingResult bindingResult) {
|
||||
public ResponseEntity<String>test(@RequestBody @Validated User user, BindingResult bindingResult) {
|
||||
// 是否存在校验错误
|
||||
if (bindingResult.hasErrors()) {
|
||||
// 获取校验不通过字段的提示信息
|
||||
|
||||
@@ -2,4 +2,9 @@ spring:
|
||||
application:
|
||||
name: han-blog
|
||||
profiles:
|
||||
active: dev
|
||||
active: dev
|
||||
jwt:
|
||||
# 签发人
|
||||
issuer: Hanserwei
|
||||
# 秘钥
|
||||
secret: P81m2EjMkZj74ht+OuBCxsf25if8PzghbEEWASyf4zcYnxwwn3VbCiIohxmowYg/8I4mj6eJdaqLbJEhggUq3Q==
|
||||
Reference in New Issue
Block a user