fix:图片访问
fix:权限修改
This commit is contained in:
1 parent
dec9fd96e3
commit
d86bc810cc
69 files changed
+1264
-458
No files matched your search
+8
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user