260517
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import store from '@/store'
|
||||
|
||||
// 获取合并的数据
|
||||
export const mergeConfig = (_this, options) => {
|
||||
//判断url是不是链接
|
||||
@@ -5,10 +7,14 @@ export const mergeConfig = (_this, options) => {
|
||||
let config = Object.assign({
|
||||
timeout: _this.timeout
|
||||
}, _this.config, options);
|
||||
|
||||
// 动态从 store 中获取最新的 apiUrl
|
||||
const dynamicApiUrl = store.getters.apiUrl || _this.baseUrl;
|
||||
|
||||
if (options.method == "FILE") {
|
||||
config.url = urlType ? options.url : _this.fileUrl + options.url;
|
||||
config.url = urlType ? options.url : (dynamicApiUrl || _this.fileUrl) + options.url;
|
||||
} else {
|
||||
config.url = urlType ? options.url : _this.baseUrl + options.url;
|
||||
config.url = urlType ? options.url : dynamicApiUrl + options.url;
|
||||
}
|
||||
//请求头
|
||||
if (options.header) {
|
||||
|
||||
Reference in New Issue
Block a user