123
This commit is contained in:
1 parent
6ac13817a4
commit
4bf3e66a3a
2 files changed
+15
-5
No files matched your search
@@ -1,9 +1,9 @@
|
||||
package com.ruoyi.web.controller.openapi;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* http://127.0.0.1:2020/oauth/token
|
||||
* Basic Auth lu7213/123456
|
||||
@@ -12,13 +12,23 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* scope:openapi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/openapi/test")
|
||||
@RequestMapping("/openapi")
|
||||
public class OpenApiController {
|
||||
|
||||
|
||||
@GetMapping
|
||||
public String test(){
|
||||
@GetMapping("/test1")
|
||||
public String test1(){
|
||||
return "oauth2 ok";
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/test2")
|
||||
public String test2(Authentication authentication) {
|
||||
|
||||
Object jwt = authentication.getPrincipal();
|
||||
//
|
||||
// String clientId = jwt.getClaimAsString("client_id");
|
||||
|
||||
return "ddd";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user