|
|
|
@ -41,7 +41,16 @@ export default {
@@ -41,7 +41,16 @@ export default {
|
|
|
|
|
handler (val) { |
|
|
|
|
this.configData.forEach(ele => { |
|
|
|
|
let result = getFunction(val[ele], true) |
|
|
|
|
window.$glob[ele] = typeof result === 'function' && result() || {} |
|
|
|
|
// 默认基础参数
|
|
|
|
|
const defaultGlob = {} |
|
|
|
|
switch (ele) { |
|
|
|
|
case 'header': |
|
|
|
|
defaultGlob['Authorization'] = window.$glob.header['Authorization'] |
|
|
|
|
break |
|
|
|
|
case 'query': |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
window.$glob[ele] = Object.assign(typeof result === 'function' && result() || {}, defaultGlob) |
|
|
|
|
delete window.$glob[ele][''] |
|
|
|
|
}) |
|
|
|
|
window.$glob.url = val.url |
|
|
|
|