Browse Source

fix: 不能覆盖默认值

master
wangxiang 2 years ago
parent
commit
fbcf97cf45
  1. 11
      cloud/bigscreen-design/src/mixins/index.js

11
cloud/bigscreen-design/src/mixins/index.js

@ -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

Loading…
Cancel
Save