Răsfoiți Sursa

app下载修改

xujie 1 an în urmă
părinte
comite
f0f64f2cfb

+ 2 - 2
src/components/K-FileUpload/index.vue

@@ -272,7 +272,7 @@ export default {
           this.$modal.closeLoading();
           //let imgUrl = process.env.VUE_APP_BASE_API + res.data.url;
           let arr = [];
-          arr.push({name: res.data.realName, url: res.data.url});
+          arr.push({name: res.data.realName, url: res.data.url,fileCode: res.data.code});
           this.fileValueList = this.fileValueList.concat(arr);
           this.$modal.msgSuccess("上传成功!");
           this.$emit("success", );
@@ -301,7 +301,7 @@ export default {
       let tempArry = [];
       for (let i in list) {
         // console.log("listToString2 i",i);
-        tempArry.push(JSON.stringify({url: list[i].url, name: list[i].name}));
+        tempArry.push(JSON.stringify({url: list[i].url, name: list[i].name, fileCode: list[i].fileCode}));
       }
       console.log("listToString2", tempArry);
       return tempArry;

+ 16 - 6
src/views/system/version/index.vue

@@ -76,9 +76,12 @@
 		  </el-table-column>
 		  <el-table-column  align="center" label="下载地址" prop="path">
 			<template v-if="scope.row.type !== 3" slot-scope="scope">
-				<el-button size="mini" type="text"
+<!--				<el-button size="mini" type="text"
 						 @click="downloadVersionFile(scope.row)">点击下载
-			    </el-button>
+			    </el-button>-->
+        <a :href="downloadUrl + scope.row.packageName" target="_blank">
+          <span style="color: dodgerblue">点击下载</span>
+        </a>
 			</template>
 		  </el-table-column>
 		  <el-table-column align="center" label="说明" prop="note" width="200">
@@ -133,7 +136,7 @@
 			<el-form-item v-if="form.type!=='3'" label="上传文件" ref="files" prop="fileList">
               <K-file-upload
                 ref="upload"
-                :defaultValue="formFileListDefualtValue"
+                :defaultValue="formFileListDefaultValue"
                 v-model="form.fileList"
                 :limit="1"
                 :fileType="['apk']"
@@ -179,7 +182,8 @@
       return {
       // 遮罩层
       loading: true,
-      formFileListDefualtValue: [],
+      formFileListDefaultValue: [],
+      downloadUrl: "",
       // 选中数组
       ids: [],
       // 非单个停用
@@ -261,6 +265,11 @@
 	    /** 查询角色列表 */
 	    getList() {
 		    this.loading = true;
+        if (process.env.VUE_APP_BASE_API.endsWith("/")){
+          this.downloadUrl = process.env.VUE_APP_BASE_API + "system/version/download/";
+        }else {
+          this.downloadUrl = process.env.VUE_APP_BASE_API + "/system/version/download/";
+        }
 		    listVersion(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
 			    this.versionList= response.rows;
 			    this.total = response.total;
@@ -279,7 +288,7 @@
 	    },
 	    // 表单重置
 	    reset() {
-		    this.formFileListDefualtValue = [],
+		    this.formFileListDefaultValue = [],
 		    this.form = {
           version: null,
           type: null,
@@ -316,7 +325,7 @@
             let fileList = [];
             fileList.push(JSON.stringify(file));
             this.form.fileList = fileList;
-            this.formFileListDefualtValue = fileList;
+            this.formFileListDefaultValue = fileList;
 			      this.form.type = this.form.type + '';
 		  	    this.open = true;
 		  	    this.title = "编辑版本号";
@@ -334,6 +343,7 @@
 				    let file = JSON.parse(this.form.fileList[0]);
             	this.form.path = file.url;
             	this.form.packageName = file.name;
+              this.form.fileCode = file.fileCode;
 			  }
 			  if (this.form.id != undefined) {
 			  	updateVersion(this.form).then(response => {