Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
salesgpt-project
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f166ea04
authored
Mar 05, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
配置服务
1 parent
a2df9973
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
src/config/index.js
src/main.js
src/mixins/socket.js
src/config/index.js
View file @
f166ea0
...
...
@@ -4,16 +4,15 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-0
2-24 09:51:41
* @LastEditTime: 2024-0
3-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
)
{
...
...
src/main.js
View file @
f166ea0
...
...
@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-0
2-24 13:51:58
* @LastEditTime: 2024-0
3-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
)
...
...
src/mixins/socket.js
View file @
f166ea0
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment