Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro
# Conflicts: # yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/vo/client/SocialClientRespVO.java
This commit is contained in:
commit
e1bac0818f
@ -27,12 +27,12 @@ public class SocialClientRespVO {
|
|||||||
@Schema(description = "客户端密钥", requiredMode = Schema.RequiredMode.REQUIRED, example = "peter")
|
@Schema(description = "客户端密钥", requiredMode = Schema.RequiredMode.REQUIRED, example = "peter")
|
||||||
private String clientSecret;
|
private String clientSecret;
|
||||||
|
|
||||||
@Schema(description = "publicKey公钥", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000045")
|
@Schema(description = "授权方的网页应用编号", example = "2000045")
|
||||||
private String publicKey;
|
|
||||||
|
|
||||||
@Schema(description = "授权方的网页应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000045")
|
|
||||||
private String agentId;
|
private String agentId;
|
||||||
|
|
||||||
|
@Schema(description = "publicKey 公钥", example = "2000045")
|
||||||
|
private String publicKey;
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,9 @@ public class SocialClientSaveReqVO {
|
|||||||
@Schema(description = "授权方的网页应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000045")
|
@Schema(description = "授权方的网页应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000045")
|
||||||
private String agentId;
|
private String agentId;
|
||||||
|
|
||||||
|
@Schema(description = "publicKey 公钥", example = "2000045")
|
||||||
|
private String publicKey;
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
@NotNull(message = "状态不能为空")
|
@NotNull(message = "状态不能为空")
|
||||||
@InEnum(CommonStatusEnum.class)
|
@InEnum(CommonStatusEnum.class)
|
||||||
@ -61,4 +64,12 @@ public class SocialClientSaveReqVO {
|
|||||||
|| !StrUtil.isEmpty(agentId);
|
|| !StrUtil.isEmpty(agentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AssertTrue(message = "publicKey 不能为空")
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isPublicKeyValid() {
|
||||||
|
// 如果是支付宝,必须填写 publicKey 属性
|
||||||
|
return !Objects.equals(socialType, SocialTypeEnum.ALIPAY.getType())
|
||||||
|
|| !StrUtil.isEmpty(publicKey);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,4 +81,12 @@ public class SocialClientDO extends TenantBaseDO {
|
|||||||
*/
|
*/
|
||||||
private String agentId;
|
private String agentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* publicKey 公钥
|
||||||
|
*
|
||||||
|
* 目前只有部分“社交类型”在使用:
|
||||||
|
* 1. 支付宝:支付宝公钥
|
||||||
|
*/
|
||||||
|
private String publicKey;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -210,6 +210,10 @@ public class SocialClientServiceImpl implements SocialClientService {
|
|||||||
return new AuthAlipayRequest(newAuthConfig, client.getPublicKey());
|
return new AuthAlipayRequest(newAuthConfig, client.getPublicKey());
|
||||||
}
|
}
|
||||||
// 2.3 设置会 request 里,进行后续使用
|
// 2.3 设置会 request 里,进行后续使用
|
||||||
|
if (SocialTypeEnum.ALIPAY_MINI_PROGRAM.getType().equals(socialType)) {
|
||||||
|
// 特殊:如果是支付宝的小程序,多了 publicKey 属性,可见 AuthConfig 里的 alipayPublicKey 字段说明
|
||||||
|
return new AuthAlipayRequest(newAuthConfig, client.getPublicKey());
|
||||||
|
}
|
||||||
ReflectUtil.setFieldValue(request, "config", newAuthConfig);
|
ReflectUtil.setFieldValue(request, "config", newAuthConfig);
|
||||||
}
|
}
|
||||||
return request;
|
return request;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user