feat: 解决启动失败问题
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.budwk.app.base.config;
|
||||
|
||||
import org.nutz.boot.config.impl.YamlConfigureLoader;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class WkYamlConfigureLoader extends YamlConfigureLoader {
|
||||
|
||||
private static final Pattern PLACEHOLDER = Pattern.compile("\\$\\{([^{}]+)}");
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
super.init();
|
||||
for (String key : get().getKeys()) {
|
||||
resolve(key, new HashSet<>());
|
||||
}
|
||||
}
|
||||
|
||||
private String resolve(String key, Set<String> resolving) {
|
||||
String value = get().get(key);
|
||||
if (value == null) {
|
||||
throw new IllegalArgumentException("Missing configuration property: " + key);
|
||||
}
|
||||
if (!resolving.add(key)) {
|
||||
throw new IllegalArgumentException("Circular configuration reference: " + key);
|
||||
}
|
||||
Matcher matcher = PLACEHOLDER.matcher(value);
|
||||
StringBuffer resolved = new StringBuffer();
|
||||
while (matcher.find()) {
|
||||
String replacement = resolve(matcher.group(1), resolving);
|
||||
matcher.appendReplacement(resolved, Matcher.quoteReplacement(replacement));
|
||||
}
|
||||
matcher.appendTail(resolved);
|
||||
resolving.remove(key);
|
||||
String result = resolved.toString();
|
||||
get().put(key, result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
org.nutz.boot.config.impl.YamlConfigureLoader
|
||||
com.budwk.app.base.config.WkYamlConfigureLoader
|
||||
|
||||
@@ -25,7 +25,7 @@ sdk:
|
||||
wxwork:
|
||||
enable: true
|
||||
corpId: wwaca81b3016b9a58c
|
||||
corpSecret: Auc7919Su1Uds5ZErfZybBrt-8FkP5NA-dldZyQuOrM
|
||||
corpSecret: Auc7919Su1Uds5ZErfZybBrt-8FkP5NA
|
||||
agentId: 1000131
|
||||
redirectUri: /platform/wxwork/oauth2/callback
|
||||
wx:
|
||||
@@ -35,17 +35,17 @@ sdk:
|
||||
redirectUri: /platform/wx/oauth2/callback
|
||||
cas:
|
||||
enable: false
|
||||
server-url-prefix: https://i.njupt.edu.cn/cas
|
||||
server-login-url: https://i.njupt.edu.cn/cas/login
|
||||
qi-wx-server-login-url: httos:/cas.whcp.eou.cn/lyuapServer/wechatauz/wxAuthRedirect
|
||||
client-host-url: https://zhgh.njupt.edu.cn
|
||||
server-url-prefix: https://i.zjnu.njupt.edu.cn/cas
|
||||
server-login-url: https://i.zjnu.njupt.edu.cn/cas/login
|
||||
qi-wx-server-login-url: httos:/cas.zjnu.whcp.eou.cn/lyuapServer/wechatauz/wxAuthRedirect
|
||||
client-host-url: https://zhgh.zjnu.njupt.edu.cn
|
||||
client-call-back-url: /platform/sso/login
|
||||
validation-type: cas
|
||||
minio:
|
||||
accessKey: o1MwuzixNqAXh5zqEfMH
|
||||
secretKey: RVnZum91JmGO79qtzWy2gKMBsF6OxAaibGrr7ets
|
||||
endPoint: http://localhost:9000
|
||||
bucket: njupt
|
||||
bucket: zjnu
|
||||
|
||||
custom:
|
||||
spdb:
|
||||
@@ -59,14 +59,14 @@ custom:
|
||||
scope: read
|
||||
username: 3848A3C738EFBB2C2E76E0D59B419DACA16A80F3AB0354CD
|
||||
password: 3848A3C738EFBB2C2E76E0D59B419DACA16A80F3AB0354CD
|
||||
token-url: https://bd.whcp.edu.cn/sjjkfwpt/api/bd-api/oauth/token
|
||||
token-url: https://bd.whcp.zjnu.edu.cn/sjjkfwpt/api/bd-api/oauth/token
|
||||
urls:
|
||||
teacher: https://bd.whcp.edu.cn/sjjkfwpt/api/bd-api/get/JZGJCSJZLB
|
||||
unit: https://bd.whcp.edu.cn/sjjkfwpt/api/bd-api/get/YXSDWJBSJZLB
|
||||
teacher: https://bd.whcp.zjnu.edu.cn/sjjkfwpt/api/bd-api/get/JZGJCSJZLB
|
||||
unit: https://bd.whcp.zjnu.edu.cn/sjjkfwpt/api/bd-api/get/YXSDWJBSJZLB
|
||||
msg:
|
||||
platform:
|
||||
enabled: false
|
||||
base-url: https://msg.cug.edu.cn
|
||||
base-url: https://msg.zjnu.cug.edu.cn
|
||||
tp-name: nwszl.cug.edu.cn
|
||||
default-send-user-id: 790036
|
||||
default-send-user-name: 周斐霏
|
||||
|
||||
@@ -35,17 +35,17 @@ sdk:
|
||||
redirectUri: /platform/wx/oauth2/callback
|
||||
cas:
|
||||
enable: false
|
||||
server-url-prefix: https://i.njupt.edu.cn/cas
|
||||
server-login-url: https://i.njupt.edu.cn/cas/login
|
||||
server-url-prefix: https://i.zjnu.edu.cn/cas
|
||||
server-login-url: https://i.zjnu.edu.cn/cas/login
|
||||
qi-wx-server-login-url: httos:/cas.whcp.eou.cn/lyuapServer/wechatauz/wxAuthRedirect
|
||||
client-host-url: https://zhgh.njupt.edu.cn
|
||||
client-host-url: https://zhgh.zjnu.edu.cn
|
||||
client-call-back-url: /platform/sso/login
|
||||
validation-type: cas
|
||||
minio:
|
||||
accessKey: o1MwuzixNqAXh5zqEfMH
|
||||
secretKey: RVnZum91JmGO79qtzWy2gKMBsF6OxAaibGrr7ets
|
||||
endPoint: http://localhost:9000
|
||||
bucket: njupt
|
||||
bucket: zjnu
|
||||
|
||||
custom:
|
||||
spdb:
|
||||
|
||||
Reference in New Issue
Block a user