🐛 Fixing a bug.fix "Request method 'POST' not supported" error on login

This commit is contained in:
lishangbu 2019-03-06 11:52:15 +08:00
parent b0cb1e0770
commit 678b10c33a
3 changed files with 5 additions and 8 deletions

View File

@ -56,10 +56,7 @@ public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
.authorizeRequests()
.antMatchers(
"/actuator/**",
"/oauth/logout",
"/oauth/logout/*",
"/oauth/token/page",
"/mobile/**").permitAll()
"/token/**").permitAll()
.anyRequest().authenticated()
.and().csrf().disable();
}

View File

@ -50,7 +50,7 @@ import java.util.Map;
*/
@RestController
@AllArgsConstructor
@RequestMapping("/oauth")
@RequestMapping("/token")
public class PigTokenEndpoint {
private static final String PROJECT_OAUTH_ACCESS = SecurityConstants.PROJECT_PREFIX + SecurityConstants.OAUTH_PREFIX + "access:";
private static final String CURRENT = "current";
@ -98,7 +98,7 @@ public class PigTokenEndpoint {
* @param params 分页参数
* @param from 标志
*/
@PostMapping("/token/page")
@PostMapping("/page")
public R getTokenPage(@RequestBody Map<String, Object> params, @RequestHeader(required = false) String from) {
if (StrUtil.isBlank(from)) {
return null;

View File

@ -38,7 +38,7 @@ public interface RemoteTokenService {
* @param from 内部调用标志
* @return page
*/
@PostMapping("/oauth/token/page")
@PostMapping("/token/page")
R getTokenPage(@RequestBody Map<String, Object> params, @RequestHeader(SecurityConstants.FROM) String from);
/**
@ -48,6 +48,6 @@ public interface RemoteTokenService {
* @param from 调用标志
* @return
*/
@DeleteMapping("/oauth/{token}")
@DeleteMapping("/token/{token}")
R<Boolean> removeToken(@PathVariable("token") String token, @RequestHeader(SecurityConstants.FROM) String from);
}