应用表单增加回调url和应用分类字段,重定向url改为单个字符串
This commit is contained in:
@@ -8,29 +8,29 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
# MYSQL数据库 主库,业务库
|
||||
url: jdbc:mysql://127.0.0.1:3306/demo?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
# MYSQL数据库 主库,业务库
|
||||
url: jdbc:mysql://10.9.0.16:3307/gr_repoort?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&lowerCaseTableNames=1 # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root
|
||||
password: qihua
|
||||
lideeyunji: # 从库,框架库
|
||||
url: jdbc:mysql://127.0.0.1:3306/demo?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://10.9.0.16:3307/gr_repoort?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&lowerCaseTableNames=1 # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root
|
||||
password: qihua
|
||||
slave: # 日志库单独
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://127.0.0.1:3306/demo?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://10.9.0.16:3307/dgr_repoort?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&lowerCaseTableNames=1 # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root
|
||||
password: qihua
|
||||
bidb: # 日志库单独
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://127.0.0.1:3306/erp_bi_data?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://10.9.0.16:3307/erp_bi_data?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&lowerCaseTableNames=1 # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root
|
||||
password: qihua
|
||||
redis:
|
||||
host: 127.0.0.1 # 地址
|
||||
host: 10.9.0.116 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 2 # 数据库索引
|
||||
password: lidee@123 # 密码,建议生产环境开启
|
||||
password: 123456 # 密码,建议生产环境开启
|
||||
|
||||
--- #################### 地代码平台相关配置 ####################
|
||||
|
||||
|
||||
Binary file not shown.
@@ -22,6 +22,9 @@ public class OAuth2ClientRespVO {
|
||||
@Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED, example = "土豆")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "应用分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "category1")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "应用图标", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/xx.png")
|
||||
private String logo;
|
||||
|
||||
@@ -37,8 +40,11 @@ public class OAuth2ClientRespVO {
|
||||
@Schema(description = "刷新令牌的有效期", requiredMode = Schema.RequiredMode.REQUIRED, example = "8640000")
|
||||
private Integer refreshTokenValiditySeconds;
|
||||
|
||||
// @Schema(description = "可重定向的 URI 地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||
// private List<String> redirectUris;
|
||||
|
||||
@Schema(description = "可重定向的 URI 地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||
private List<String> redirectUris;
|
||||
private String redirectUris;
|
||||
|
||||
@Schema(description = "授权类型,参见 OAuth2GrantTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "password")
|
||||
private List<String> authorizedGrantTypes;
|
||||
@@ -55,6 +61,9 @@ public class OAuth2ClientRespVO {
|
||||
@Schema(description = "资源", example = "1024")
|
||||
private List<String> resourceIds;
|
||||
|
||||
@Schema(description = "回调URI地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||
private String callbackUris;
|
||||
|
||||
@Schema(description = "附加信息", example = "{yunai: true}")
|
||||
private String additionalInformation;
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@ public class OAuth2ClientSaveReqVO {
|
||||
@NotNull(message = "应用名不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "应用分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "category1")
|
||||
@NotNull(message = "应用分类不能为空")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "应用图标", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/xx.png")
|
||||
@NotNull(message = "应用图标不能为空")
|
||||
@URL(message = "应用图标的地址不正确")
|
||||
@@ -50,9 +54,13 @@ public class OAuth2ClientSaveReqVO {
|
||||
@NotNull(message = "刷新令牌的有效期不能为空")
|
||||
private Integer refreshTokenValiditySeconds;
|
||||
|
||||
// @Schema(description = "可重定向的 URI 地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||
// @NotNull(message = "可重定向的 URI 地址不能为空")
|
||||
// private List<@NotEmpty(message = "重定向的 URI 不能为空") @URL(message = "重定向的 URI 格式不正确") String> redirectUris;
|
||||
|
||||
|
||||
@Schema(description = "可重定向的 URI 地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||
@NotNull(message = "可重定向的 URI 地址不能为空")
|
||||
private List<@NotEmpty(message = "重定向的 URI 不能为空") @URL(message = "重定向的 URI 格式不正确") String> redirectUris;
|
||||
private String redirectUris;
|
||||
|
||||
@Schema(description = "授权类型,参见 OAuth2GrantTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "password")
|
||||
@NotNull(message = "授权类型不能为空")
|
||||
@@ -73,6 +81,9 @@ public class OAuth2ClientSaveReqVO {
|
||||
@Schema(description = "附加信息", example = "{yunai: true}")
|
||||
private String additionalInformation;
|
||||
|
||||
@Schema(description = "回调URI地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||
private String callbackUris;
|
||||
|
||||
@AssertTrue(message = "附加信息必须是 JSON 格式")
|
||||
public boolean isAdditionalInformationJson() {
|
||||
return StrUtil.isEmpty(additionalInformation) || JsonUtils.isJson(additionalInformation);
|
||||
|
||||
@@ -43,6 +43,11 @@ public class OAuth2ClientDO extends BaseDO {
|
||||
* 应用名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 应用分类
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 应用图标
|
||||
*/
|
||||
@@ -65,11 +70,14 @@ public class OAuth2ClientDO extends BaseDO {
|
||||
* 刷新令牌的有效期
|
||||
*/
|
||||
private Integer refreshTokenValiditySeconds;
|
||||
/**
|
||||
* 可重定向的 URI 地址
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<String> redirectUris;
|
||||
// /**
|
||||
// * 可重定向的 URI 地址
|
||||
// */
|
||||
// @TableField(typeHandler = JacksonTypeHandler.class)
|
||||
// private List<String> redirectUris;
|
||||
|
||||
private String redirectUris;
|
||||
|
||||
/**
|
||||
* 授权类型(模式)
|
||||
*
|
||||
@@ -99,6 +107,12 @@ public class OAuth2ClientDO extends BaseDO {
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<String> resourceIds;
|
||||
|
||||
/**
|
||||
* 回调URI地址
|
||||
*/
|
||||
private String callbackUris;
|
||||
|
||||
/**
|
||||
* 附加信息,JSON 格式
|
||||
*/
|
||||
|
||||
@@ -136,7 +136,10 @@ public class OAuth2ClientServiceImpl implements IOAuth2ClientService {
|
||||
throw exception(OAUTH2_CLIENT_SCOPE_OVER);
|
||||
}
|
||||
// 校验回调地址
|
||||
if (StrUtil.isNotEmpty(redirectUri) && !StrUtils.startWithAny(redirectUri, client.getRedirectUris())) {
|
||||
// if (StrUtil.isNotEmpty(redirectUri) && !StrUtils.startWithAny(redirectUri, client.getRedirectUris())) {
|
||||
// throw exception(OAUTH2_CLIENT_REDIRECT_URI_NOT_MATCH, redirectUri);
|
||||
// }
|
||||
if (StrUtil.isNotEmpty(redirectUri) && ObjectUtil.notEqual(client.getRedirectUris(), redirectUri)) {
|
||||
throw exception(OAUTH2_CLIENT_REDIRECT_URI_NOT_MATCH, redirectUri);
|
||||
}
|
||||
return client;
|
||||
|
||||
Reference in New Issue
Block a user