fix:图片访问

fix:权限修改
This commit is contained in:
dzc committed 2026-10-29 14:26:56 +08:00
1 parent dec9fd96e3
commit d86bc810cc
69 files changed
+1264 -458

No files matched your search

+8 -2
View File
@@ -1,3 +1,4 @@
import { accessFileUrl, refreshFileAccess, isProtectedFile } from './file-access'
import { nextTick } from "vue"
import router from "/@/router/index"
import pinia from "/@/stores/index"
@@ -255,9 +256,10 @@ export function base64Encrypt(src: string) {
* @param fileName 文件名称
* @returns {*}
*/
export function downBlobFile(url: any, query: any, fileName: string) {
export function downBlobFile(url: any, query: any, fileName: string, retried = false) {
return request({
url: url,
url: accessFileUrl(url),
...(isProtectedFile(url) ? { baseURL: '' } : {}),
method: "get",
responseType: "blob",
params: query,
@@ -266,6 +268,10 @@ export function downBlobFile(url: any, query: any, fileName: string) {
handleBlobFile(response, fileName)
})
.catch(async (error) => {
if (!retried && isProtectedFile(url)) {
await refreshFileAccess(true)
return downBlobFile(url, query, fileName, true)
}
let msg = "下载失败"
try {
if (error instanceof Blob) {