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;