|
@@ -50,6 +50,8 @@ public class AppBootstrap {
|
|
|
|
|
|
private static String appCode;
|
|
|
|
|
|
+ private static String appSimpleName;
|
|
|
+
|
|
|
private static String configCenterHost;
|
|
|
|
|
|
private static String configCenterPort;
|
|
@@ -148,7 +150,7 @@ public class AppBootstrap {
|
|
|
|
|
|
Map<String, String> req = Maps.newHashMap();
|
|
|
req.put("active", active);
|
|
|
- req.put("appCode", appCode);
|
|
|
+ req.put("appSimpleName", appSimpleName);
|
|
|
req.put("startupCode", startupCode);
|
|
|
req.put("message", message);
|
|
|
|
|
@@ -176,7 +178,7 @@ public class AppBootstrap {
|
|
|
|
|
|
Map<String, String> req = Maps.newHashMap();
|
|
|
req.put("active", active);
|
|
|
- req.put("appCode", appCode);
|
|
|
+ req.put("appSimpleName", appSimpleName);
|
|
|
req.put("startupCode", startupCode);
|
|
|
|
|
|
Response resp = null;
|
|
@@ -190,9 +192,11 @@ public class AppBootstrap {
|
|
|
String body = resp.body().string();
|
|
|
|
|
|
String encryptedAppId = resp.header("App-Id");
|
|
|
+ String encryptedAppCode = resp.header("App-Code");
|
|
|
String encryptedSecretKey = resp.header("Secret-Key");
|
|
|
|
|
|
appId = StringUtil.toLong(BootstrapSecurityUtil.decrypt(encryptedAppId, startupCode));
|
|
|
+ appCode = BootstrapSecurityUtil.decrypt(encryptedAppCode, startupCode);
|
|
|
secretKey = BootstrapSecurityUtil.decrypt(encryptedSecretKey, startupCode);
|
|
|
|
|
|
String decryptedBody = BootstrapSecurityUtil.decrypt(body, startupCode);
|
|
@@ -232,8 +236,8 @@ public class AppBootstrap {
|
|
|
configCenterHost = s.substring(s.indexOf("=") + 1);
|
|
|
} else if (s.startsWith("--examcloud.startup.configCenterPort=")) {
|
|
|
configCenterPort = s.substring(s.indexOf("=") + 1);
|
|
|
- } else if (s.startsWith("--examcloud.startup.appCode=")) {
|
|
|
- appCode = s.substring(s.indexOf("=") + 1);
|
|
|
+ } else if (s.startsWith("--examcloud.startup.appSimpleName=")) {
|
|
|
+ appSimpleName = s.substring(s.indexOf("=") + 1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -264,16 +268,16 @@ public class AppBootstrap {
|
|
|
System.exit(-1);
|
|
|
}
|
|
|
|
|
|
- // appCode
|
|
|
- if (null == appCode) {
|
|
|
- String value = props.getProperty("examcloud.startup.appCode");
|
|
|
+ // appSimpleName
|
|
|
+ if (null == appSimpleName) {
|
|
|
+ String value = props.getProperty("examcloud.startup.appSimpleName");
|
|
|
if (StringUtils.isNotBlank(value)) {
|
|
|
- appCode = value.trim();
|
|
|
+ appSimpleName = value.trim();
|
|
|
}
|
|
|
}
|
|
|
- log.info("appCode=" + appCode);
|
|
|
- if (StringUtils.isBlank(appCode)) {
|
|
|
- log.error("property[examcloud.startup.appCode] is not specified");
|
|
|
+ log.info("appSimpleName=" + appSimpleName);
|
|
|
+ if (StringUtils.isBlank(appSimpleName)) {
|
|
|
+ log.error("property[examcloud.startup.appSimpleName] is not specified");
|
|
|
System.exit(-1);
|
|
|
}
|
|
|
|