From 0082354aba6d4202f97cd8f79412d74e015f3b9f Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期二, 25 七月 2023 11:40:29 +0800 Subject: [PATCH] fix 修复 oss上传与zip下载未传输clientid问题 --- src/plugins/download.ts | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/download.ts b/src/plugins/download.ts index c6c8521..7f6202b 100644 --- a/src/plugins/download.ts +++ b/src/plugins/download.ts @@ -16,7 +16,10 @@ method: 'get', url: url, responseType: 'blob', - headers: { Authorization: 'Bearer ' + getToken() } + headers: { + Authorization: 'Bearer ' + getToken(), + clientid: import.meta.env.VITE_APP_CLIENT_ID + } }); const isBlob = blobValidate(res.data); if (isBlob) { @@ -42,7 +45,8 @@ responseType: 'blob', headers: { Authorization: 'Bearer ' + getToken(), - datasource: localStorage.getItem('dataName') + datasource: localStorage.getItem('dataName'), + clientid: import.meta.env.VITE_APP_CLIENT_ID } }); const isBlob = blobValidate(res.data); @@ -54,8 +58,8 @@ } downloadLoadingInstance.close(); } catch (r) { - console.error(r) - ElMessage.error('涓嬭浇鏂囦欢鍑虹幇閿欒锛岃鑱旂郴绠$悊鍛橈紒') + console.error(r); + ElMessage.error('涓嬭浇鏂囦欢鍑虹幇閿欒锛岃鑱旂郴绠$悊鍛橈紒'); downloadLoadingInstance.close(); } }, -- Gitblit v1.9.3