Browse Source
Merge pull request #681 from flipped-aurora/gva-vue3
修复本地模式下的文件下载问题
main
奇淼(piexlmax
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
11 additions and
3 deletions
-
web/src/mixins/infoList.js
-
web/src/view/example/upload/upload.vue
|
|
@ -44,14 +44,18 @@ export default { |
|
|
|
this.page = val |
|
|
|
this.getTableData() |
|
|
|
}, |
|
|
|
async getTableData(page = this.page, pageSize = this.pageSize) { |
|
|
|
const table = await this.listApi({ page, pageSize, ...this.searchInfo }) |
|
|
|
// @params beforeFunc function 请求发起前执行的函数 默认为空函数
|
|
|
|
// @params afterFunc function 请求完成后执行的函数 默认为空函数
|
|
|
|
async getTableData(beforeFunc = () => {}, afterFunc = () => {}) { |
|
|
|
beforeFunc() |
|
|
|
const table = await this.listApi({ page: this.page, pageSize: this.pageSize, ...this.searchInfo }) |
|
|
|
if (table.code === 0) { |
|
|
|
this.tableData = table.data.list |
|
|
|
this.total = table.data.total |
|
|
|
this.page = table.data.page |
|
|
|
this.pageSize = table.data.pageSize |
|
|
|
} |
|
|
|
afterFunc() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -163,7 +163,11 @@ export default { |
|
|
|
this.fullscreenLoading = false |
|
|
|
}, |
|
|
|
downloadFile(row) { |
|
|
|
downloadImage(row.url, row.name) |
|
|
|
if (row.url.indexOf('http://') > -1 || row.url.indexOf('https://') > -1) { |
|
|
|
downloadImage(row.url, row.name) |
|
|
|
} else { |
|
|
|
downloadImage(this.path + row.url, row.name) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|