From 7276c85268da0c89fbcf0293c3cb6e0053c8395b Mon Sep 17 00:00:00 2001
From: 吴学文 <wuxuewen@wuxuewendeMacBook-Pro.local>
Date: 星期二, 07 五月 2019 17:24:38 +0800
Subject: [PATCH] 加入房屋保存接口信息

---
 WebService/src/main/java/com/java110/web/core/VueComponentTemplate.java |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/WebService/src/main/java/com/java110/web/core/VueComponentTemplate.java b/WebService/src/main/java/com/java110/web/core/VueComponentTemplate.java
index f230386..248dc15 100644
--- a/WebService/src/main/java/com/java110/web/core/VueComponentTemplate.java
+++ b/WebService/src/main/java/com/java110/web/core/VueComponentTemplate.java
@@ -3,7 +3,6 @@
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.util.StringUtils;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -20,28 +19,28 @@
     /**
      * 榛樿鎵弿璺緞
      */
-    public final static String DEFAULT_COMPONENT_PACKAGE_PATH = "components";
+    public static final String DEFAULT_COMPONENT_PACKAGE_PATH = "components";
 
     /**
      * js 鏂囦欢
      */
-    public final static String COMPONENT_JS = "js";
+    public static final String COMPONENT_JS = "js";
 
     /**
      * css 鏂囦欢
      */
-    public final static String COMPONENT_CSS = "css";
+    public static final String COMPONENT_CSS = "css";
 
     /**
      * html 鏂囦欢
      */
-    public final static String COMPONENT_HTML = "html";
+    public static final String COMPONENT_HTML = "html";
 
 
     /**
      * HTML 鏂囦欢缂撳瓨鍣�
      */
-    private final static Map<String, String> componentTemplate = new HashMap<>();
+    private static final Map<String, String> componentTemplate = new HashMap<>();
 
 
     /**
@@ -88,9 +87,18 @@
                 b.append((char) tempChar);
             }
             sb = b.toString();
-            if (!StringUtils.isEmpty(sb)) {
-                componentTemplate.put(filePath.substring(filePath.lastIndexOf(File.separator) + 1, filePath.length()), sb);
+            if (StringUtils.isEmpty(sb)) {
+                return;
             }
+            String componentKey = "";
+            //杩欓噷鍦╳indow 璇诲彇jar鍖呬腑鏂囦欢鏃讹紝涔熸槸 / 浣嗘槸鐩存帴鍚姩鏃� 涓篭杩欎釜 鎵�浠ヤ笉鑳界敤 File.separator 
+            if (filePath.contains("/")) {
+                componentKey = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.length());
+            } else {
+                componentKey = filePath.substring(filePath.lastIndexOf("\\") + 1, filePath.length());
+            }
+            componentTemplate.put(componentKey, sb);
+
         } catch (IOException e) {
             e.printStackTrace();
         } finally {

--
Gitblit v1.8.0