Sfoglia il codice sorgente

feature:增加文件地址配置

liuzhenlin 5 mesi fa
parent
commit
f508f07793

+ 3 - 1
App.vue

@@ -53,9 +53,11 @@
         }
       },
       completionImgPath(path) {
+        const filePath =
+          uni.getStorageSync("labsop_filePath") || process.uniEnv.VITE_FILE;
         let url = path;
         if (url.indexOf("http") == -1) {
-          url = process.uniEnv.VITE_FILE + url;
+          url = filePath + url;
         }
         return url;
       },

+ 3 - 1
pages/home/index.vue

@@ -587,9 +587,11 @@
         });
       },
       completionImgPath(path) {
+        const filePath =
+          uni.getStorageSync("labsop_filePath") || process.uniEnv.VITE_FILE;
         let url = path;
         if (url.indexOf("http") == -1) {
-          url = process.uniEnv.VITE_FILE + url;
+          url = filePath + url;
         }
         return url;
       },

+ 48 - 8
pages/setting/index.vue

@@ -82,6 +82,17 @@
           />
         </view>
       </view>
+      <view class="input-col">
+        <view class="title">文件路径:</view>
+        <view class="input-box">
+          <input
+            class="lab-input"
+            v-model="filePath"
+            type="text"
+            placeholder="请输入文件路径"
+          />
+        </view>
+      </view>
     </view>
   </view>
 </template>
@@ -98,6 +109,7 @@
         service_path: "",
         sdkKey: "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp",
         headerImg: "static/images/header.png",
+        filePath: "",
       };
     },
     onMounted() {
@@ -116,41 +128,58 @@
         "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp";
       this.headerImg =
         uni.getStorageSync("labsop_headerImg") || "static/images/header.png";
+      this.filePath = uni.getStorageSync("labsop_filePath") || "";
     },
     onShow() {
       this.ip =
         uni.getStorageSync("labsop_ip") ||
         process.uniEnv.VUE_APP_MicroSrvProxy_API;
+
       this.no = uni.getStorageSync("labsop_no") || "";
+
       this.tenant =
         uni.getStorageSync("labsop_tenant") || process.uniEnv.VUE_APP_TENANT;
+
       this.token =
         uni.getStorageSync("labsop_android_token") ||
         process.uniEnv.VUE_APP_TOKEN;
+
       this.service_path = uni.getStorageSync("labsop_service_path") || "";
+
       this.sdkKey =
         uni.getStorageSync("labsop_sdkKey") ||
         "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp";
+
       this.headerImg =
         uni.getStorageSync("labsop_headerImg") || "static/images/header.png";
+
+      this.filePath = uni.getStorageSync("labsop_filePath") || "";
     },
     onLoad() {},
     methods: {
       testSave() {
+        // 测试用的方法
         uni.setStorageSync("labsop_ip", this.ip || "");
+
         uni.setStorageSync("labsop_no", this.no || "");
+
         uni.setStorageSync("labsop_tenant", this.tenant || "");
+
         uni.setStorageSync("labsop_android_token", this.token || "");
+
         uni.setStorageSync("labsop_service_path", this.service_path || "");
+
         uni.setStorageSync(
           "labsop_sdkKey",
           this.sdkKey || "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp"
         );
-        this.headerImg =
-          uni.getStorageSync("labsop_headerImg") || "static/images/header.png";
-        uni.redirectTo({
-          url: "/",
-        });
+
+        uni.setStorageSync(
+          "labsop_headerImg",
+          this.headerImg || "static/images/header.png"
+        );
+
+        uni.setStorageSync("labsop_filePath", this.filePath || "");
       },
       // 激活引擎
       confirm() {
@@ -178,25 +207,36 @@
                 success: (res) => {
                   if (res.confirm) {
                     this.clearFace();
+
                     uni.setStorageSync("labsop_ip", this.ip || "");
+
                     uni.setStorageSync("labsop_no", this.no || "");
+
                     uni.setStorageSync("labsop_tenant", this.tenant || "");
+
                     uni.setStorageSync(
                       "labsop_android_token",
                       this.token || ""
                     );
+
                     uni.setStorageSync(
                       "labsop_service_path",
                       this.service_path || ""
                     );
+
                     uni.setStorageSync(
                       "labsop_sdkKey",
                       this.sdkKey ||
                         "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp"
                     );
-                    this.headerImg =
-                      uni.getStorageSync("labsop_headerImg") ||
-                      "static/images/header.png";
+
+                    uni.setStorageSync(
+                      "labsop_headerImg",
+                      this.headerImg || "static/images/header.png"
+                    );
+
+                    uni.setStorageSync("labsop_filePath", this.filePath || "");
+
                     uni.showToast({
                       title: "保存成功",
                       duration: 1000,

+ 1 - 1
unpackage/cache/apk/apkurl

@@ -1 +1 @@
-https://app.liuyingyong.cn/build/download/502d5f20-5019-11f0-b6c7-e5f523f2f2db
+https://app.liuyingyong.cn/build/download/ed238900-509f-11f0-b0e0-dfc6cde5db4d

File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/apk/cmManifestCache.json


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__499A04E/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__499A04E/app-view.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-view.js


Some files were not shown because too many files changed in this diff