修改依赖
This commit is contained in:
parent
f13b3e8cc6
commit
fa11707377
@ -31,12 +31,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security</groupId>
|
<groupId>org.springframework.security</groupId>
|
||||||
<artifactId>spring-security-jwt</artifactId>
|
<artifactId>spring-security-jwt</artifactId>
|
||||||
<version>1.0.9.RELEASE</version>
|
<version>1.1.1.RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security.oauth.boot</groupId>
|
<groupId>org.springframework.security.oauth.boot</groupId>
|
||||||
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
|
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
|
||||||
<version>2.5.13</version>
|
<version>2.0.0.RELEASE</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
@ -41,12 +41,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security</groupId>
|
<groupId>org.springframework.security</groupId>
|
||||||
<artifactId>spring-security-jwt</artifactId>
|
<artifactId>spring-security-jwt</artifactId>
|
||||||
<version>1.0.9.RELEASE</version>
|
<version>1.1.1.RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security.oauth.boot</groupId>
|
<groupId>org.springframework.security.oauth.boot</groupId>
|
||||||
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
|
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
|
||||||
<version>2.5.13</version>
|
<version>2.0.0.RELEASE</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
@ -31,7 +31,6 @@ public class OAuth2ClientResourceController extends DefaultBaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IOAuth2ClientMenuService oAuth2ClientMenuService;
|
private IOAuth2ClientMenuService oAuth2ClientMenuService;
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "Oauth2客户端菜单列表", notes = "Oauth2客户端菜单列表接口")
|
@ApiOperation(value = "Oauth2客户端菜单列表", notes = "Oauth2客户端菜单列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "clientId", value = "客户端ID", paramType = "path"),
|
@ApiImplicitParam(name = "clientId", value = "客户端ID", paramType = "path"),
|
||||||
|
@ -56,7 +56,7 @@ public class OAuth2ClientAuthorizationEndpoint extends AbstractEndpoint {
|
|||||||
private SessionAttributeStore sessionAttributeStore = new DefaultSessionAttributeStore();
|
private SessionAttributeStore sessionAttributeStore = new DefaultSessionAttributeStore();
|
||||||
private OAuth2RequestValidator oauth2RequestValidator = new DefaultOAuth2RequestValidator();
|
private OAuth2RequestValidator oauth2RequestValidator = new DefaultOAuth2RequestValidator();
|
||||||
private String userApprovalPage = "error/oauth_confirm_access";
|
private String userApprovalPage = "error/oauth_confirm_access";
|
||||||
private String errorPage = "error/oauth_error";
|
private String errorPage = "error/exception";
|
||||||
private Object implicitLock = new Object();
|
private Object implicitLock = new Object();
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserApprovalHandler userApprovalHandler;
|
private UserApprovalHandler userApprovalHandler;
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package ink.wgink.login.oauth2.server.exceptions;
|
||||||
|
|
||||||
|
import org.springframework.security.oauth2.common.exceptions.ClientAuthenticationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: OAuth2ClientMenuException
|
||||||
|
* @Description: 单点登录客户端菜单异常
|
||||||
|
* @Author: wanggeng
|
||||||
|
* @Date: 2022/5/26 17:17
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
public class OAuth2ClientMenuException extends ClientAuthenticationException {
|
||||||
|
|
||||||
|
|
||||||
|
public OAuth2ClientMenuException(String msg) {
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getHttpErrorCode() {
|
||||||
|
return 401;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOAuth2ErrorCode() {
|
||||||
|
return "menu_error";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -2,7 +2,6 @@ package ink.wgink.login.oauth2.server.service.impl;
|
|||||||
|
|
||||||
import ink.wgink.common.base.DefaultBaseService;
|
import ink.wgink.common.base.DefaultBaseService;
|
||||||
import ink.wgink.exceptions.DependencyException;
|
import ink.wgink.exceptions.DependencyException;
|
||||||
import ink.wgink.exceptions.ParamsException;
|
|
||||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
import ink.wgink.interfaces.menu.IMenuBaseService;
|
import ink.wgink.interfaces.menu.IMenuBaseService;
|
||||||
import ink.wgink.interfaces.role.IRoleMenuBaseService;
|
import ink.wgink.interfaces.role.IRoleMenuBaseService;
|
||||||
@ -14,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,7 +43,7 @@ public class OAuth2ClientMenuServiceImpl extends DefaultBaseService implements I
|
|||||||
}
|
}
|
||||||
OAuth2ClientPO oAuth2ClientPO = oAuth2ClientService.getPO(clientId);
|
OAuth2ClientPO oAuth2ClientPO = oAuth2ClientService.getPO(clientId);
|
||||||
if (StringUtils.isBlank(oAuth2ClientPO.getMenuId())) {
|
if (StringUtils.isBlank(oAuth2ClientPO.getMenuId())) {
|
||||||
throw new ParamsException("客户端未绑定菜单");
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
List<String> menuIds;
|
List<String> menuIds;
|
||||||
if (StringUtils.equals(roleIds.get(0), ISystemConstant.ADMIN)) {
|
if (StringUtils.equals(roleIds.get(0), ISystemConstant.ADMIN)) {
|
||||||
|
2
pom.xml
2
pom.xml
@ -57,7 +57,7 @@
|
|||||||
<spring.version>5.3.20</spring.version>
|
<spring.version>5.3.20</spring.version>
|
||||||
<spring-security.version>5.2.9.RELEASE</spring-security.version>
|
<spring-security.version>5.2.9.RELEASE</spring-security.version>
|
||||||
<spring-boot.version>2.7.0</spring-boot.version>
|
<spring-boot.version>2.7.0</spring-boot.version>
|
||||||
<fastjson.version>1.2.25</fastjson.version>
|
<fastjson.version>1.2.83</fastjson.version>
|
||||||
<fastjson2.version>2.0.2</fastjson2.version>
|
<fastjson2.version>2.0.2</fastjson2.version>
|
||||||
<json.version>20210307</json.version>
|
<json.version>20210307</json.version>
|
||||||
<easyexcel.version>3.0.5</easyexcel.version>
|
<easyexcel.version>3.0.5</easyexcel.version>
|
||||||
|
Loading…
Reference in New Issue
Block a user