diff --git a/src/utils/oss.js b/src/utils/oss.js index dba5248f..723d155e 100644 --- a/src/utils/oss.js +++ b/src/utils/oss.js @@ -23,9 +23,6 @@ async function ossGenerateSTS() { res = await GetObjectStoreToken() localStorage.setItem('stsToken', JSON.stringify(res)) } - const urlParams = new URLSearchParams(window.location.search) - - const trialId = urlParams.get('trialId') // res.Result.ObjectStoreUse = 'AWS'; Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] } Vue.prototype.OSSclientConfig.ObjectStoreUse = res.Result.ObjectStoreUse; @@ -56,6 +53,8 @@ async function ossGenerateSTS() { } let res = await OSSclient.put(objectName, object) if (res && res.url) { + const urlParams = new URLSearchParams(window.location.search) + const trialId = urlParams.get('trialId') if (Object.keys(fileInfo).length !== 0) { let params = Object.assign({path: objectName}, fileInfo) addOrUpdateFileUploadRecord(params) @@ -106,6 +105,8 @@ async function ossGenerateSTS() { } let res = await customerHttp(OSSclient, data, progress); if (res) { + const urlParams = new URLSearchParams(window.location.search) + const trialId = urlParams.get('trialId') if (Object.keys(fileInfo).length !== 0) { let params = Object.assign({path: data.path}, fileInfo) addOrUpdateFileUploadRecord(params)