Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks-h5
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
quantum-blocks-h5
Commits
af2d4ef7
Commit
af2d4ef7
authored
Nov 29, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build(config.js): 调整前端获取apollo方式
parent
4c42c926
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
9 deletions
+32
-9
dev.config.ts
app/web/config/dev.config.ts
+2
-2
prod.config.ts
app/web/config/prod.config.ts
+28
-5
test.config.ts
app/web/config/test.config.ts
+2
-2
No files found.
app/web/config/dev.config.ts
View file @
af2d4ef7
import
apolloSsr
from
'
../../../config/apollo.ssr.json
'
;
const
protocol
=
EASY_ENV_IS_BROWSER
?
window
.
location
.
protocol
:
'
https
'
;
const
protocol
=
EASY_ENV_IS_BROWSER
?
window
.
location
.
protocol
:
'
https
:
'
;
const
hostMap
=
{
apiHost
:
`
${
protocol
}
//quantum-blocks-tob.liangkebang.net`
,
kdspHost
:
`
${
protocol
}
//talos-tob.liangkebang.net`
,
shenceUrl
:
`
${
protocol
}
//bn.xyqb.com/sa?project=default`
,
mallHost
:
`
${
protocol
}
:
//mall-tob.liangkebang.net`
,
mallHost
:
`
${
protocol
}
//mall-tob.liangkebang.net`
,
test
:
true
,
yxmTenantId
:
560761
,
appIdMap
:
{
...
...
app/web/config/prod.config.ts
View file @
af2d4ef7
// const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https';
import
apolloSsr
from
'
../../../config/apollo.ssr.json
'
;
const
protocol
=
EASY_ENV_IS_BROWSER
?
window
.
location
.
protocol
:
'
https:
'
;
export
default
{
apiHost
:
`
https:
//quantum-blocks.q-gp.com`
,
kdspHost
:
`
https:
//talos.q-gp.com`
,
shenceUrl
:
`
https:
//bn.xyqb.com/sa?project=production`
,
mallHost
:
`
https:
//mall.q-gp.com`
,
const
hostMap
=
{
apiHost
:
`
${
protocol
}
//quantum-blocks.q-gp.com`
,
kdspHost
:
`
${
protocol
}
//talos.q-gp.com`
,
shenceUrl
:
`
${
protocol
}
//bn.xyqb.com/sa?project=production`
,
mallHost
:
`
${
protocol
}
//mall.q-gp.com`
,
test
:
false
,
yxmTenantId
:
560761
,
appIdMap
:
{
...
...
@@ -12,3 +14,24 @@ export default {
560867
:
'
wxbd0bc68b270a1dab
'
,
},
};
if
(
EASY_ENV_IS_BROWSER
)
{
const
apolloWin
=
window
.
apollo
||
window
.
__INITIAL_STATE__
.
apollo
;
if
(
apolloWin
)
{
for
(
const
key
in
apolloWin
)
{
if
(
apolloWin
[
key
])
{
hostMap
[
key
]
=
apolloWin
[
key
];
}
}
}
}
if
(
EASY_ENV_IS_NODE
)
{
if
(
apolloSsr
)
{
for
(
const
key
in
apolloSsr
)
{
if
(
apolloSsr
[
key
])
{
hostMap
[
key
]
=
apolloSsr
[
key
];
}
}
}
}
export
default
hostMap
;
app/web/config/test.config.ts
View file @
af2d4ef7
import
apolloSsr
from
'
../../../config/apollo.ssr.json
'
;
const
protocol
=
EASY_ENV_IS_BROWSER
?
window
.
location
.
protocol
:
'
https
'
;
const
protocol
=
EASY_ENV_IS_BROWSER
?
window
.
location
.
protocol
:
'
https
:
'
;
const
hostMap
=
{
apiHost
:
`
${
protocol
}
//quantum-blocks-test1.liangkebang.net`
,
kdspHost
:
`
${
protocol
}
//talos-test1.liangkebang.net`
,
shenceUrl
:
`
${
protocol
}
//bn.xyqb.com/sa?project=default`
,
mallHost
:
`
${
protocol
}
:
//mall-test1.liangkebang.net`
,
mallHost
:
`
${
protocol
}
//mall-test1.liangkebang.net`
,
test
:
true
,
yxmTenantId
:
560761
,
appIdMap
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment