From 0f29a2971c37802e1e5bf690b72e834cb48691c8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-6C3NK6N\\WXS" <815034831@qq.com> Date: Fri, 13 Sep 2024 10:23:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=87=AD=E8=AF=81=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/oss.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/oss.js b/src/utils/oss.js index 6bf8f550..e4a324cf 100644 --- a/src/utils/oss.js +++ b/src/utils/oss.js @@ -15,7 +15,14 @@ Vue.prototype.OSSclientConfig = { async function ossGenerateSTS() { - let res = await GetObjectStoreToken() + let res = null; + if (localStorage.getItem('stsToken')) { + res = JSON.parse(localStorage.getItem('stsToken')) + } else { + res = await GetObjectStoreToken() + localStorage.setItem('stsToken', JSON.stringify(res)) + } + // res.Result.ObjectStoreUse = 'AWS'; Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] } Vue.prototype.OSSclientConfig.ObjectStoreUse = res.Result.ObjectStoreUse;