diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/SystemEnvHelper.java b/contact-center/app/src/main/java/com/chatopera/cc/util/SystemEnvHelper.java index c3b44881d4ceb84e32a9d5189ea9d77b5ec6b47d..5b6f091e0dc33a04c613f86efc1572c3728d3833 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/SystemEnvHelper.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/SystemEnvHelper.java @@ -68,7 +68,7 @@ public class SystemEnvHelper { * @return */ public static String parseFromApplicationProps(final String property) { - // 将 propert转化为环境变量 + // 将 property 转化为环境变量 String P = StringUtils.upperCase(property); P = StringUtils.replaceChars(P, "-", "_"); @@ -82,14 +82,26 @@ public class SystemEnvHelper { } /** - * 记载application.properties + * Get properties filename + * @return + */ + private static String getPropsFileName() { + String profile = getenv("SPRING_PROFILES_ACTIVE", ""); + if (StringUtils.isNotBlank(profile)) { + return "application-" + profile + ".properties"; + } + return "application.properties"; + } + + /** + * 加载 application.properties * * @return */ private static Properties getProps() { if (props == null) { try (InputStream input = SystemEnvHelper.class.getClassLoader().getResourceAsStream( - "application.properties")) { + getPropsFileName())) { // load a properties file props = new Properties(); props.load(input); diff --git a/contact-center/app/src/main/resources/templates/apps/im/chatbot/index.pug b/contact-center/app/src/main/resources/templates/apps/im/chatbot/index.pug index 167395acaa97dbf07a86ea5f4a9895a77c933b09..6804dd9293882d8d70c2ea1395b876ab818cb78d 100644 --- a/contact-center/app/src/main/resources/templates/apps/im/chatbot/index.pug +++ b/contact-center/app/src/main/resources/templates/apps/im/chatbot/index.pug @@ -561,11 +561,11 @@ html if (allowClick) { allowClick = false; socket.emit('message', { - appid: "${appid!''}", - userid: "${userid!''}", + appid: "#{appid}", + userid: "#{userid}", type: "message", - session: "${sessionid!''}", - orgi: "${orgi!''}", + session: "#{sessionid}", + orgi: "#{orgi}", message: key }); } @@ -587,11 +587,11 @@ html var regClick = function (key) { btn.click(function () { socket.emit('message', { - appid: "${appid!''}", - userid: "${userid!''}", + appid: "#{appid}", + userid: "#{userid}", type: "message", - session: "${sessionid!''}", - orgi: "${orgi!''}", + session: "#{sessionid}", + orgi: "#{orgi}", message: key }); }); @@ -629,7 +629,7 @@ html content = createCard(message, expmsg); } - var box = $('