Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-h5-ailipay
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 b232a222
authored
Mar 17, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
请求配置修改
1 parent
0200292f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
28 deletions
src/main.js
src/main.js
View file @
b232a22
...
@@ -41,12 +41,12 @@ Vue.prototype.to = function (name, params) {
...
@@ -41,12 +41,12 @@ Vue.prototype.to = function (name, params) {
// import 'lib-flexible/flexible.js'
// import 'lib-flexible/flexible.js'
import
VConsole
from
'vconsole'
import
VConsole
from
'vconsole'
var
baseConfig
=
{
//
var baseConfig = {
axios
:
{
//
axios: {
appkey
:
'd7ffc3346fc9a45bccaaa35300d59022'
,
//
appkey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret
:
'4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
//
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
//
}
}
//
}
import
*
as
Sentry
from
'@sentry/vue'
import
*
as
Sentry
from
'@sentry/vue'
import
{
BrowserTracing
}
from
'@sentry/tracing'
import
{
BrowserTracing
}
from
'@sentry/tracing'
...
@@ -66,6 +66,27 @@ process.env.NODE_ENV === 'production' &&
...
@@ -66,6 +66,27 @@ process.env.NODE_ENV === 'production' &&
// We recommend adjusting this value in production
// We recommend adjusting this value in production
tracesSampleRate
:
1.0
tracesSampleRate
:
1.0
})
})
const
baseConfig
=
{
sysName
:
'嘀加支付宝h5系统'
,
hasReg
:
false
,
hasAuth
:
false
,
vconsole
:
true
,
env
:
'develop'
,
axios
:
{
baseURL
:
'http://192.168.3.226:9711'
,
appkey
:
'48e5e13229b82c1b4e6e8c96151f0637'
,
secret
:
'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
,
timeout
:
50000
,
result
:
{
data_key
:
'data'
,
message_key
:
'message'
,
code_key
:
'code'
,
code_success_value
:
0
,
code_message_map
:
{}
}
}
}
window
.
$fetchConfig
=
baseConfig
// const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
// const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
...
@@ -82,32 +103,38 @@ fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-c
...
@@ -82,32 +103,38 @@ fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-c
)
)
.
then
(
response
=>
{
.
then
(
response
=>
{
console
.
log
(
response
)
console
.
log
(
response
)
const
{
code
,
data
}
=
response
const
{
code
,
data
}
=
response
code
==
'200'
&&
((
baseConfig
=
data
),
(
window
.
$fetchConfig
=
data
))
if
(
code
==
'200'
)
{
baseConfig
=
data
window
.
$fetchConfig
=
data
}
else
{
baseConfig
=
response
window
.
$fetchConfig
=
response
}
// && ((baseConfig = data), (window.$fetchConfig = data))
})
})
.
catch
(
el
=>
{
.
catch
(
el
=>
{
// console.log(el)
// console.log(el)
baseConfig
=
{
//
baseConfig = {
sysName
:
'嘀加支付宝h5系统'
,
//
sysName: '嘀加支付宝h5系统',
hasReg
:
false
,
//
hasReg: false,
hasAuth
:
false
,
//
hasAuth: false,
vconsole
:
true
,
//
vconsole: true,
env
:
'develop'
,
//
env: 'develop',
axios
:
{
//
axios: {
baseURL
:
'http://192.168.3.226:9711'
,
//
baseURL: 'http://192.168.3.226:9711',
appkey
:
'48e5e13229b82c1b4e6e8c96151f0637'
,
//
appkey: '48e5e13229b82c1b4e6e8c96151f0637',
secret
:
'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
,
//
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
timeout
:
50000
,
//
timeout: 50000,
result
:
{
//
result: {
data_key
:
'data'
,
//
data_key: 'data',
message_key
:
'message'
,
//
message_key: 'message',
code_key
:
'code'
,
//
code_key: 'code',
code_success_value
:
0
,
//
code_success_value: 0,
code_message_map
:
{}
//
code_message_map: {}
}
//
}
}
//
}
}
//
}
})
})
.
finally
(()
=>
{
.
finally
(()
=>
{
init
()
init
()
...
...
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