Browse Source

修复
1. 文件静态资源的一些问题
2. 将登录成功提示缩短至 1 秒

dusenyao 3 years ago
parent
commit
f75f48f443
2 changed files with 17 additions and 8 deletions
  1. 4 1
      src/views/login/index.vue
  2. 13 7
      src/views/upload/uploadDetail.vue

+ 4 - 1
src/views/login/index.vue

@@ -98,7 +98,10 @@ export default {
             .then(() => {
               this.$router.push({ path: '/jump' });
               this.loading = false;
-              this.$message.success('登录成功!');
+              this.$message.success({
+                message: '登录成功!',
+                duration: 1 * 1000
+              });
             })
             .catch(() => {
               this.loading = false;

+ 13 - 7
src/views/upload/uploadDetail.vue

@@ -22,12 +22,13 @@
         </el-form-item>
         <el-form-item label="上传资源" label-width="90px" prop="fileList">
           <el-upload
-            :action="url"
+            action="url"
             :limit="1"
             :on-exceed="handleExceed"
             :on-preview="handlePreview"
             :on-remove="handleRemove"
             :http-request="upload"
+            :file-list="fileList"
             accept="*"
             class="upload-demo"
             list-type="picture"
@@ -89,11 +90,6 @@ export default {
       }
     };
   },
-  computed: {
-    url() {
-      return process.env.VUE_APP_BASE_API + '/GCLSFileServer/WebFileUpload';
-    }
-  },
   watch: {
     resource_key: {
       handler: function (val, oldVal) {
@@ -168,7 +164,16 @@ export default {
     upload(file) {
       fileUpload('Open', file).then(response => {
         if (response.status === 1) {
-          this.fileList = response.file_info_list;
+          response.file_info_list.forEach((item, index) => {
+            if (item.file_url) {
+              let obj = {
+                name: item.file_name,
+                url: item.file_url,
+                file_id: item.file_id
+              };
+              this.fileList.push(obj);
+            }
+          });
           this.$message.success('上传成功');
         } else {
           this.$message.warning(response.error);
@@ -191,6 +196,7 @@ export default {
       };
       getContent(MethodName, data)
         .then(res => {
+          this.fileList = [];
           res.file_list.forEach((item, index) => {
             this.searchForm = item;
             if (item.file_url) {