Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
ReactWeb5
CivWeb
Commits
05a325c1
Commit
05a325c1
authored
Apr 08, 2022
by
邓晓峰
Browse files
Options
Browse Files
Download
Plain Diff
feat: add PageContainer component
parents
c428b7f9
c8e8f510
Pipeline
#47491
skipped with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
16 deletions
+53
-16
proxy.js
config/proxy.js
+30
-0
index.js
src/api/index.js
+20
-14
base.js
src/api/service/base.js
+1
-1
Site.js
src/layouts/Site.js
+2
-1
No files found.
config/proxy.js
View file @
05a325c1
...
...
@@ -8,6 +8,26 @@ const proxyURL = 'https://panda-water.cn';
module
.
exports
=
{
assetsRoot
:
process
.
env
.
NODE_ENV
!==
'production'
?
proxyURL
:
'./'
,
dev
:
{
'/PandaOMS'
:{
target
:
proxyURL
,
changeOrigin
:
true
,
headers
:
{
'Access-Control-Allow-Origin'
:
'*'
,
},
pathRewrite
:
{
'/PandaOMS'
:
'/PandaOMS'
,
},
},
'/PandaWater'
:{
target
:
proxyURL
,
changeOrigin
:
true
,
headers
:
{
'Access-Control-Allow-Origin'
:
'*'
,
},
pathRewrite
:
{
'/PandaWater'
:
'/PandaWater'
,
},
},
'/Panda_GIS'
:
{
target
:
proxyURL
,
changeOrigin
:
true
,
...
...
@@ -52,6 +72,16 @@ module.exports = {
'/cityinterface'
:
'/cityinterface'
,
},
},
'/Cityinterface'
:
{
target
:
proxyURL
,
changeOrigin
:
true
,
headers
:
{
'Access-Control-Allow-Origin'
:
'*'
,
},
pathRewrite
:
{
'/Cityinterface'
:
'/CityInterface'
,
},
},
'/cityjson'
:
{
target
:
'https://pv.sohu.com'
,
// target: 'http://192.168.19.102:8055',
...
...
src/api/index.js
View file @
05a325c1
...
...
@@ -12,25 +12,31 @@ instanceRequest.transformRequestURL = function(url) {
const
excludeURL
=
[
'/PandaCore/GCK/Basis/GateWayConfig'
,
'/CityInterface/rest/services.svc/GetConfig'
,
'/PandaOMS/OMS/HostManager/GetGateWay'
,
'/Identity/AuthorizationToken'
];
if
(
excludeURL
.
includes
(
url
))
{
return
url
;
}
if
(
window
.
globalConfig
&&
window
.
globalConfig
.
hasGateWay
&&
/^
\/(
cityinterface|CityInterface|Cityinterface|CityServer|PandaInformatization
)
/
.
test
(
url
,
)
)
{
return
/
\/
CityInterface
\/
rest
\/
services.svc
\/
GetConfig/
.
test
(
url
)
?
url
?
/^
\/
GateWay/
.
test
(
url
)
?
url
:
`/GateWay
${
url
}
`
:
`/GateWay
${
url
}
`
:
`/GateWay
${
url
}
`
;
// if (
// window.globalConfig &&
// window.globalConfig.hasGateWay &&
// /^\/(cityinterface|CityInterface|Cityinterface|CityServer|PandaInformatization)/.test(
// url,
// )
// ) {
// return /\/CityInterface\/rest\/services.svc\/GetConfig/.test(url)
// ? url
// ? /^\/GateWay/.test(url)
// ? url
// : `/GateWay${url}`
// : `/GateWay${url}`
// : `/GateWay${url}`;
// }
if
(
window
.
globalConfig
&&
window
.
globalConfig
.
hasGateWay
)
{
return
url
&&
/^
\/
GateWay/
.
test
(
url
)
?
url
:
`/GateWay
${
url
}
`
}
return
url
;
};
...
...
src/api/service/base.js
View file @
05a325c1
...
...
@@ -11,7 +11,7 @@ const transformGateWay = url => {
export
const
API
=
{
AUTHORIZATION_TOKEN
:
'/Identity/AuthorizationToken'
,
GET_GATEWAY_CONFIG
:
'/Panda
Core/GCK/Basis/GateWayConfig
'
,
GET_GATEWAY_CONFIG
:
'/Panda
OMS/OMS/HostManager/GetGateWay
'
,
GET_CONFIG
:
'/CityInterface/rest/services.svc/GetConfig'
,
GENERATE_TOKEN
:
'/cityinterface/rest/services.svc/generatetoken'
,
GENERATE_GATEWAT_TOKEN
:
'/GCK/Basis/GenerateToken'
,
...
...
src/layouts/Site.js
View file @
05a325c1
...
...
@@ -378,11 +378,12 @@ class Site {
self
.
props
&&
self
.
props
.
updateComplexConfig
&&
self
.
props
.
updateComplexConfig
({});
// 切换站点,加载首页,否则默认加载web4
self
.
props
.
history
&&
self
.
props
.
history
.
push
(
self
.
globalConfig
.
homepage
?
`/
${
self
.
globalConfig
.
homepage
}
`
:
`/
?client=
${
self
.
globalConfig
.
client
}
`
,
:
`/
civweb4
`
,
);
// window.location.reload();
window
.
share
.
event
.
emit
(
'triggerMicro'
,
this
.
props
.
global
);
...
...
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