This commit is contained in:
joylink_fanyuhong 2021-12-29 13:44:05 +08:00
parent 68b9524cce
commit 3c2563e3d1
9 changed files with 13 additions and 9 deletions

View File

@ -4,7 +4,7 @@ const publicPath = process.env.VUE_APP_PRO == 'local' ? '' : '/cbtc';
export const JL3D_LOCAL_STATIC = publicPath+"/static"; export const JL3D_LOCAL_STATIC = publicPath+"/static";
const BASE_UPLOAD_API = process.env.VUE_APP_UPLOAD_API; 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(JL3D_LOCAL_STATIC);
// console.log(BASE_UPLOAD_API); // console.log(BASE_UPLOAD_API);
// console.log(BASE_ASSET_API); // console.log(BASE_ASSET_API);

View File

@ -77,7 +77,7 @@ export default {
size: 3, size: 3,
action: `${process.env.VUE_APP_UPLOAD_API}/api/upload/PICTURE?appId=00001&appSecret=joylink00001`, action: `${process.env.VUE_APP_UPLOAD_API}/api/upload/PICTURE?appId=00001&appSecret=joylink00001`,
response: (res) => { response: (res) => {
return `${process.env.VUE_APP_VOICE_API}${res.data}`; return `${this.$store.user.state.resourcesUrl}${res.data}`;
}, },
error: () => { that.$message.error('图片上传失败,请检查网络状态'); }, error: () => { that.$message.error('图片上传失败,请检查网络状态'); },
sizeError: () => { that.$message.error('图片上传失败图片大小限制3MB'); } // sizeError: () => { that.$message.error('图片上传失败图片大小限制3MB'); } //

View File

@ -95,6 +95,9 @@ router.beforeEach( async (to, from, next) => {
} else { } else {
store.dispatch('setBaseUrl', getBaseUrl()); store.dispatch('setBaseUrl', getBaseUrl());
} }
if (resp && resp.data && resp.data.resourcesDomainName) {
store.dispatch('setResourcesUrl', resp.data.resourcesDomainName);
}
} catch (e) { } catch (e) {
store.dispatch('setBaseUrl', getBaseUrl()); store.dispatch('setBaseUrl', getBaseUrl());
} }

View File

@ -21,7 +21,8 @@ const user = {
companyAdmin: false, companyAdmin: false,
companyName: '', companyName: '',
companyProjectList: [], companyProjectList: [],
baseUrl:'' baseUrl:'',
resourcesUrl: process.env.VUE_APP_VOICE_API
}, },
mutations: { mutations: {
@ -216,7 +217,7 @@ const user = {
setBaseUrl ({commit}, baseUrl) { setBaseUrl ({commit}, baseUrl) {
commit('setBaseUrl', baseUrl); commit('setBaseUrl', baseUrl);
}, },
setResourcesUrl({}, resourcesUrl) { setResourcesUrl({commit}, resourcesUrl) {
commit('setResourcesUrl', resourcesUrl); commit('setResourcesUrl', resourcesUrl);
}, },
setToken({commit}, token) { setToken({commit}, token) {

View File

@ -95,7 +95,7 @@ export default {
resultMap: {}, resultMap: {},
loading: false, loading: false,
audioPlayId: '', audioPlayId: '',
baseUrl:process.env.VUE_APP_VOICE_API baseUrl:this.$store.user.state.resourcesUrl
}; };
}, },
watch: { watch: {

View File

@ -84,7 +84,7 @@ export default {
recordSendingId: null, recordSendingId: null,
audioDataMap: {}, audioDataMap: {},
audioPlayId: '', audioPlayId: '',
baseUrl:process.env.VUE_APP_VOICE_API baseUrl:this.$store.user.state.resourcesUrl
}; };
}, },
watch: { watch: {

View File

@ -56,7 +56,7 @@ export default {
}); });
uploadFile(action, that.formData).then(resp => { 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); insertImgFn(imgUrl);
}).catch(error => { console.log(error); }); }).catch(error => { console.log(error); });
}; };

View File

@ -204,7 +204,7 @@ export default {
}, },
avatarUrl(val) { avatarUrl(val) {
if (val && val.creatorAvatarPath) { if (val && val.creatorAvatarPath) {
return process.env.VUE_APP_VOICE_API + val.creatorAvatarPath; return this.$store.user.state.resourcesUrl + val.creatorAvatarPath;
} else { } else {
return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png'; return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png';
} }

View File

@ -84,7 +84,7 @@ export default {
// yuyin:yuyin, // yuyin:yuyin,
currentAudioIndex:0, currentAudioIndex:0,
isPlay:false, isPlay:false,
baseUrl:process.env.VUE_APP_VOICE_API baseUrl: this.$store.user.state.resourcesUrl
}; };
}, },
watch:{ watch:{