From 3c2563e3d19de217440ab1fd54e1486cd0c7713e Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Wed, 29 Dec 2021 13:44:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jlmap3d/assets3d.js | 2 +- src/components/QuillEditor/index.vue | 2 +- src/permission.js | 3 +++ src/store/modules/user.js | 5 +++-- src/views/drts/scene/trainingResult.vue | 2 +- src/views/drts/scene/voiceTraining.vue | 2 +- src/views/editor/index.vue | 2 +- src/views/messageBoard/index.vue | 2 +- src/views/newMap/chatView/chatContent.vue | 2 +- 9 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/api/jlmap3d/assets3d.js b/src/api/jlmap3d/assets3d.js index ea1a8238c..a7abce7b2 100644 --- a/src/api/jlmap3d/assets3d.js +++ b/src/api/jlmap3d/assets3d.js @@ -4,7 +4,7 @@ const publicPath = process.env.VUE_APP_PRO == 'local' ? '' : '/cbtc'; export const JL3D_LOCAL_STATIC = publicPath+"/static"; const BASE_UPLOAD_API = process.env.VUE_APP_UPLOAD_API; -export const BASE_ASSET_API = process.env.VUE_APP_VOICE_API; +export const BASE_ASSET_API = this.$store.user.state.resourcesUrl; // console.log(JL3D_LOCAL_STATIC); // console.log(BASE_UPLOAD_API); // console.log(BASE_ASSET_API); diff --git a/src/components/QuillEditor/index.vue b/src/components/QuillEditor/index.vue index 17795b027..37c7dd208 100644 --- a/src/components/QuillEditor/index.vue +++ b/src/components/QuillEditor/index.vue @@ -77,7 +77,7 @@ export default { size: 3, action: `${process.env.VUE_APP_UPLOAD_API}/api/upload/PICTURE?appId=00001&appSecret=joylink00001`, response: (res) => { - return `${process.env.VUE_APP_VOICE_API}${res.data}`; + return `${this.$store.user.state.resourcesUrl}${res.data}`; }, error: () => { that.$message.error('图片上传失败,请检查网络状态'); }, sizeError: () => { that.$message.error('图片上传失败,图片大小限制3MB'); } // 图片超过大小的回调 diff --git a/src/permission.js b/src/permission.js index f7fd84604..ad5a051dc 100644 --- a/src/permission.js +++ b/src/permission.js @@ -95,6 +95,9 @@ router.beforeEach( async (to, from, next) => { } else { store.dispatch('setBaseUrl', getBaseUrl()); } + if (resp && resp.data && resp.data.resourcesDomainName) { + store.dispatch('setResourcesUrl', resp.data.resourcesDomainName); + } } catch (e) { store.dispatch('setBaseUrl', getBaseUrl()); } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index f38809366..ff71d64ee 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -21,7 +21,8 @@ const user = { companyAdmin: false, companyName: '', companyProjectList: [], - baseUrl:'' + baseUrl:'', + resourcesUrl: process.env.VUE_APP_VOICE_API }, mutations: { @@ -216,7 +217,7 @@ const user = { setBaseUrl ({commit}, baseUrl) { commit('setBaseUrl', baseUrl); }, - setResourcesUrl({}, resourcesUrl) { + setResourcesUrl({commit}, resourcesUrl) { commit('setResourcesUrl', resourcesUrl); }, setToken({commit}, token) { diff --git a/src/views/drts/scene/trainingResult.vue b/src/views/drts/scene/trainingResult.vue index 3351a9942..8f972d99a 100644 --- a/src/views/drts/scene/trainingResult.vue +++ b/src/views/drts/scene/trainingResult.vue @@ -95,7 +95,7 @@ export default { resultMap: {}, loading: false, audioPlayId: '', - baseUrl:process.env.VUE_APP_VOICE_API + baseUrl:this.$store.user.state.resourcesUrl }; }, watch: { diff --git a/src/views/drts/scene/voiceTraining.vue b/src/views/drts/scene/voiceTraining.vue index 2e1997c9b..ec950d496 100644 --- a/src/views/drts/scene/voiceTraining.vue +++ b/src/views/drts/scene/voiceTraining.vue @@ -84,7 +84,7 @@ export default { recordSendingId: null, audioDataMap: {}, audioPlayId: '', - baseUrl:process.env.VUE_APP_VOICE_API + baseUrl:this.$store.user.state.resourcesUrl }; }, watch: { diff --git a/src/views/editor/index.vue b/src/views/editor/index.vue index a1e85ad1f..dbe779aec 100644 --- a/src/views/editor/index.vue +++ b/src/views/editor/index.vue @@ -56,7 +56,7 @@ export default { }); uploadFile(action, that.formData).then(resp => { - const imgUrl = process.env.VUE_APP_VOICE_API + resp.data; + const imgUrl = this.$store.user.state.resourcesUrl + resp.data; insertImgFn(imgUrl); }).catch(error => { console.log(error); }); }; diff --git a/src/views/messageBoard/index.vue b/src/views/messageBoard/index.vue index e5dec87b1..8093202f4 100644 --- a/src/views/messageBoard/index.vue +++ b/src/views/messageBoard/index.vue @@ -204,7 +204,7 @@ export default { }, avatarUrl(val) { if (val && val.creatorAvatarPath) { - return process.env.VUE_APP_VOICE_API + val.creatorAvatarPath; + return this.$store.user.state.resourcesUrl + val.creatorAvatarPath; } else { return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png'; } diff --git a/src/views/newMap/chatView/chatContent.vue b/src/views/newMap/chatView/chatContent.vue index 15b245f94..71bed8c37 100644 --- a/src/views/newMap/chatView/chatContent.vue +++ b/src/views/newMap/chatView/chatContent.vue @@ -84,7 +84,7 @@ export default { // yuyin:yuyin, currentAudioIndex:0, isPlay:false, - baseUrl:process.env.VUE_APP_VOICE_API + baseUrl: this.$store.user.state.resourcesUrl }; }, watch:{