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';
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',
......
......@@ -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;
};
......
......@@ -11,7 +11,7 @@ const transformGateWay = url => {
export const API = {
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',
GENERATE_TOKEN: '/cityinterface/rest/services.svc/generatetoken',
GENERATE_GATEWAT_TOKEN: '/GCK/Basis/GenerateToken',
......
......@@ -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);
......
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