Commit 05a325c1 authored by 邓晓峰's avatar 邓晓峰

feat: add PageContainer component

parents c428b7f9 c8e8f510
Pipeline #47491 skipped with stages
...@@ -8,6 +8,26 @@ const proxyURL = 'https://panda-water.cn'; ...@@ -8,6 +8,26 @@ const proxyURL = 'https://panda-water.cn';
module.exports = { module.exports = {
assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './', assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './',
dev: { 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': { '/Panda_GIS': {
target: proxyURL, target: proxyURL,
changeOrigin: true, changeOrigin: true,
...@@ -52,6 +72,16 @@ module.exports = { ...@@ -52,6 +72,16 @@ module.exports = {
'/cityinterface': '/cityinterface', '/cityinterface': '/cityinterface',
}, },
}, },
'/Cityinterface': {
target: proxyURL,
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
},
pathRewrite: {
'/Cityinterface': '/CityInterface',
},
},
'/cityjson': { '/cityjson': {
target: 'https://pv.sohu.com', target: 'https://pv.sohu.com',
// target: 'http://192.168.19.102:8055', // target: 'http://192.168.19.102:8055',
......
...@@ -12,25 +12,31 @@ instanceRequest.transformRequestURL = function(url) { ...@@ -12,25 +12,31 @@ instanceRequest.transformRequestURL = function(url) {
const excludeURL = [ const excludeURL = [
'/PandaCore/GCK/Basis/GateWayConfig', '/PandaCore/GCK/Basis/GateWayConfig',
'/CityInterface/rest/services.svc/GetConfig', '/CityInterface/rest/services.svc/GetConfig',
'/PandaOMS/OMS/HostManager/GetGateWay',
'/Identity/AuthorizationToken'
]; ];
if (excludeURL.includes(url)) { if (excludeURL.includes(url)) {
return url; return url;
} }
if ( // if (
window.globalConfig && // window.globalConfig &&
window.globalConfig.hasGateWay && // window.globalConfig.hasGateWay &&
/^\/(cityinterface|CityInterface|Cityinterface|CityServer|PandaInformatization)/.test( // /^\/(cityinterface|CityInterface|Cityinterface|CityServer|PandaInformatization)/.test(
url, // url,
) // )
) { // ) {
return /\/CityInterface\/rest\/services.svc\/GetConfig/.test(url) // return /\/CityInterface\/rest\/services.svc\/GetConfig/.test(url)
? url // ? url
? /^\/GateWay/.test(url) // ? /^\/GateWay/.test(url)
? url // ? url
: `/GateWay${url}` // : `/GateWay${url}`
: `/GateWay${url}` // : `/GateWay${url}`
: `/GateWay${url}`; // : `/GateWay${url}`;
// }
if(window.globalConfig && window.globalConfig.hasGateWay) {
return url && /^\/GateWay/.test(url) ? url : `/GateWay${url}`
} }
return url; return url;
}; };
......
...@@ -11,7 +11,7 @@ const transformGateWay = url => { ...@@ -11,7 +11,7 @@ const transformGateWay = url => {
export const API = { export const API = {
AUTHORIZATION_TOKEN: '/Identity/AuthorizationToken', AUTHORIZATION_TOKEN: '/Identity/AuthorizationToken',
GET_GATEWAY_CONFIG: '/PandaCore/GCK/Basis/GateWayConfig', GET_GATEWAY_CONFIG: '/PandaOMS/OMS/HostManager/GetGateWay',
GET_CONFIG: '/CityInterface/rest/services.svc/GetConfig', GET_CONFIG: '/CityInterface/rest/services.svc/GetConfig',
GENERATE_TOKEN: '/cityinterface/rest/services.svc/generatetoken', GENERATE_TOKEN: '/cityinterface/rest/services.svc/generatetoken',
GENERATE_GATEWAT_TOKEN: '/GCK/Basis/GenerateToken', GENERATE_GATEWAT_TOKEN: '/GCK/Basis/GenerateToken',
......
...@@ -378,11 +378,12 @@ class Site { ...@@ -378,11 +378,12 @@ class Site {
self.props && self.props &&
self.props.updateComplexConfig && self.props.updateComplexConfig &&
self.props.updateComplexConfig({}); self.props.updateComplexConfig({});
// 切换站点,加载首页,否则默认加载web4
self.props.history && self.props.history &&
self.props.history.push( self.props.history.push(
self.globalConfig.homepage self.globalConfig.homepage
? `/${self.globalConfig.homepage}` ? `/${self.globalConfig.homepage}`
: `/?client=${self.globalConfig.client}`, : `/civweb4`,
); );
// window.location.reload(); // window.location.reload();
window.share.event.emit('triggerMicro', this.props.global); window.share.event.emit('triggerMicro', this.props.global);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment