【修改】 监控管理的下载的文件名称为username命名
This commit is contained in:
@@ -206,7 +206,7 @@
|
||||
|
||||
<el-table-column label="操作" align="center" min-width="120px">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="downloadFile(scope.row.temporaryId)">
|
||||
<el-button link type="primary" @click="downloadFile(scope.row)">
|
||||
下载
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -378,8 +378,8 @@ const handleDelete = async (id: number) => {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
const downloadFile = async (temporaryId: string) => {
|
||||
const res = await MonitorApi.getMonitorStuFileUrl(temporaryId)
|
||||
const downloadFile = async (row: any) => {
|
||||
const res = await MonitorApi.getMonitorStuFileUrl(row.temporaryId)
|
||||
console.log(res)
|
||||
const url = res
|
||||
try {
|
||||
@@ -391,7 +391,7 @@ const downloadFile = async (temporaryId: string) => {
|
||||
const blobUrl = window.URL.createObjectURL(blob)
|
||||
|
||||
// 提取文件名
|
||||
const filename = url.substring(url.lastIndexOf('/') + 1).split('?')[0]
|
||||
const filename = row.username
|
||||
|
||||
// 创建 a 标签并下载
|
||||
const a = document.createElement('a')
|
||||
|
Reference in New Issue
Block a user