李劲龙 2 weeks ago
commit 3c62f21d17

@ -15,7 +15,8 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分 // axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API, // baseURL: process.env.VUE_APP_BASE_API,
baseURL: process.env.NODE_ENV === "production" ? location.origin + '/api' : process.env.VUE_APP_BASE_API,
// 超时 // 超时
timeout: 50000 timeout: 50000
}) })

@ -239,7 +239,8 @@ export default {
// //
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// //
url: process.env.VUE_APP_BASE_API + "/tc/assetEmail/importData" // url: process.env.VUE_APP_BASE_API + "/tc/assetEmail/importData"
url: location.origin + "/api/tc/assetEmail/importData"
}, },
} }
}, },

@ -258,7 +258,8 @@ export default {
// //
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// //
url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import" // url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import"
url: location.origin + "/api/tc/assetCurrent/importData"
}, },
} }
}, },

@ -265,7 +265,8 @@ export default {
// //
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// //
url: process.env.VUE_APP_BASE_API + "/tc/assetApp/importData" // url: process.env.VUE_APP_BASE_API + "/tc/assetApp/importData"
url: location.origin + "/api/tc/assetApp/importData"
}, },
} }
}, },

@ -251,7 +251,8 @@ export default {
// //
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// //
url: process.env.VUE_APP_BASE_API + "/tc/assetOfficialAccount/importData" // url: process.env.VUE_APP_BASE_API + "/tc/assetOfficialAccount/importData"
url: location.origin + "/api/tc/assetOfficialAccount/importData"
}, },
} }
}, },

@ -250,7 +250,8 @@ export default {
// //
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// //
url: process.env.VUE_APP_BASE_API + "/tc/miniPrograms/importData" // url: process.env.VUE_APP_BASE_API + "/tc/miniPrograms/importData"
url: location.origin + "/api/tc/miniPrograms/importData"
}, },
} }
}, },

@ -67,8 +67,10 @@ export default {
return { return {
number: 0, number: 0,
uploadList: [], uploadList: [],
baseUrl: process.env.VUE_APP_BASE_API, // baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // baseUrl: location.origin,
// uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", //
uploadFileUrl: location.origin + '/api/common/upload',
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },

Loading…
Cancel
Save