Commit f166ea04 by 前端

配置服务

1 parent a2df9973
......@@ -4,16 +4,15 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-02-24 09:51:41
* @LastEditTime: 2024-03-05 15:11:04
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
import { utils, Http } from 'glsx-common'
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function () {
let { request } = config
Object.assign(request, { timeout })
return Promise.resolve(config)
export const fetchConfig = function (common) {
let params = { moduleName: 'salesgpt-project', mockUrl: 'xxx', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return utils.getConfig(params)
}
export const cfg = {
install(vue, config) {
......
......@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-02-24 13:51:58
* @LastEditTime: 2024-03-05 15:08:11
*/
// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
......@@ -41,6 +41,7 @@ import VConsole from 'vconsole'
const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
fetchConfig().then(res => {
console.log(res)
// 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn
Vue.use(cfg)
......
......@@ -11,7 +11,7 @@ import { ROLE_LIST, AI_TYPE } from '@/utils/constants'
export default {
data() {
return {
path: 'wss://salesgpt.dev.glsx.com.cn/ws/1',
path: window.$fetchConfig.baseURL,
isShow: true,
isSend: true,
timer_chat: null,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!