Commit bda7dc67 by 李伟康

切换配置服务

1 parent 82610398
......@@ -15,7 +15,7 @@
"autoprefixer": "^8.0.0",
"core-js": "^3.6.4",
"dayjs": "^1.10.5",
"glsx-common": "^1.4.9",
"glsx-common": "^2.1.0",
"lib-flexible": "^0.3.2",
"postcss-loader": "^6.2.0",
"sha1": "^1.1.1",
......
/*
* @Descripttion:
* @version:
......@@ -7,20 +8,20 @@
* @LastEditTime: 2021-06-30 11:23:25
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
import { utils, Http } from 'glsx-common'
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
if (isEnv) {
let { request } = config
Object.assign(request, { timeout })
return Promise.resolve(config)
}
// /**测试mock*/ return window.fetch('https://oss-config.dev.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-sop-config', {}).then(res => res.json())
/**生产mock*/ return window.fetch('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-sop-config', {}).then(res => res.json())
export const fetchConfig = function (isEnv = true) {
// if (isEnv) {
// let { request } = config
// Object.assign(request, { timeout })
// return Promise.resolve(config)
// }
let params = { moduleName: 'scrm-wx-work-sop-config', mockUrl: 'https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-sop-config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return utils.getConfig(params)
}
export const cfg = {
install(vue, config) {
install (vue, config) {
vue.prototype.$config = config
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!