From c9f7314cd0e02201940a7800e5668bb4bbd932be Mon Sep 17 00:00:00 2001
From: 孤舟烟雨 <494979+gzyy@user.noreply.gitee.com>
Date: 星期五, 13 八月 2021 10:03:46 +0800
Subject: [PATCH] !77 update 对象存储配置 重构到数据库 动态配置 * 增加对象存储配置sql * 修改对象存储配置 * Merge branch 'dev' of https://gitee.com/JavaLionLi/RuoYi-Vue-Plus into dev * 增加对象存储配置 * 增加对象存储配置

---
 ruoyi-ui/src/views/system/oss/index.vue |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/ruoyi-ui/src/views/system/oss/index.vue b/ruoyi-ui/src/views/system/oss/index.vue
index 8312454..a183938 100644
--- a/ruoyi-ui/src/views/system/oss/index.vue
+++ b/ruoyi-ui/src/views/system/oss/index.vue
@@ -106,13 +106,15 @@
       <el-table-column label="鏂囦欢鍚�" align="center" prop="fileName" />
       <el-table-column label="鍘熷悕" align="center" prop="originalName" />
       <el-table-column label="鏂囦欢鍚庣紑" align="center" prop="fileSuffix" />
-      <el-table-column label="鏂囦欢灞曠ず" align="center" prop="url" >
-        <template slot-scope="scope" v-if="previewListResource">
+      <el-table-column label="鏂囦欢灞曠ず" align="center" prop="url">
+        <template slot-scope="scope">
           <el-image
-            v-if="scope.row.fileSuffix.indexOf('png','jpg','jpeg') > 0"
+            v-if="previewListResource && checkFileSuffix(scope.row.fileSuffix)"
             style="width: 100px; height: 100px;"
             :src="scope.row.url"
             :preview-src-list="[scope.row.url]"/>
+          <span v-text="scope.row.url"
+                v-if="!checkFileSuffix(scope.row.fileSuffix) || !previewListResource"/>
         </template>
       </el-table-column>
       <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180">
@@ -168,9 +170,7 @@
 
 <script>
 import { listOss, delOss } from "@/api/system/oss";
-import { downLoadOss } from "@/utils/ossdownload";
-import { updateConfig } from "@/api/system/config";
-
+import { downLoadOss } from "@/utils/download";
 
 export default {
   name: "Oss",
@@ -239,7 +239,7 @@
         this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
       }
       this.getConfigKey("sys.oss.previewListResource").then(response => {
-        this.previewListResource = response.msg;
+        this.previewListResource = response.msg === undefined ? true : response.msg === 'true';
       });
       listOss(this.queryParams).then(response => {
         this.ossList = response.rows;
@@ -247,6 +247,12 @@
         this.loading = false;
       });
     },
+    checkFileSuffix(fileSuffix) {
+      let arr = ["png", "jpg", "jpeg"];
+      return arr.some(type => {
+        return fileSuffix.indexOf(type) > -1;
+      });
+    },
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false;

--
Gitblit v1.9.3