1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-22 03:20:31 +08:00

引入 dlFile

This commit is contained in:
源文雨
2023-04-13 23:30:49 +08:00
parent b8661b5e93
commit 0e55371ffb
6 changed files with 93 additions and 12 deletions

View File

@@ -22,6 +22,7 @@
import { PageEnum } from '/@/enums/pageEnum'
import { useI18n } from '/@/hooks/web/useI18n'
import { downloadByData } from '/@/utils/file/download'
import { getToken } from '/@/utils/auth'
import axios from 'axios'
const { t } = useI18n()
@@ -85,10 +86,12 @@
try {
const ret = await downloadFile(Number(params.value.id))
if (ret && ret.url) {
const token = getToken() as string
const { data } = await axios({
method: 'get',
responseType: 'blob',
url: ret.url,
headers: { Authorization: token },
})
if (data) {
loadDocx(data)