Commit 26a927f1 by 李伟康

切换开发mock

1 parent 2b4143ab
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cfg = exports.fetchConfig = void 0;
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-01-14 17:31:13
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
var config = require('./conf.js');
var timeout = 30000; //超时时间
var fetchConfig = function fetchConfig() {
var isEnv = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
if (isEnv) {
var request = config.request;
Object.assign(request, {
timeout: timeout
});
return Promise.resolve(config);
} // return window.fetch('https://oss-config.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config', {}).then(res => res.json()) //生产
return window.fetch('https://oss-config.dev.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config', {}).then(function (res) {
return res.json();
}); //测试
};
exports.fetchConfig = fetchConfig;
var cfg = {
install: function install(vue, config) {
vue.prototype.$config = config;
}
};
exports.cfg = cfg;
\ No newline at end of file
......@@ -15,9 +15,9 @@ export const fetchConfig = function (isEnv = true) {
Object.assign(request, { timeout })
return Promise.resolve(config)
}
return window.fetch('https://oss-config.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config', {}).then(res => res.json()) //生产
// return window.fetch('https://oss-config.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config', {}).then(res => res.json()) //生产
// return window.fetch('https://oss-config.dev.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config', {}).then(res => res.json()) //测试
return window.fetch('https://oss-config.dev.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config', {}).then(res => res.json()) //测试
}
export const cfg = {
install(vue, config) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!