Commit 1e35bbac authored by 邓超's avatar 邓超

fix: 更新gis接口,添加主站配置,修改路由可以外部访问

parent 41eb0505
Pipeline #50877 passed with stages
...@@ -22,42 +22,45 @@ module.exports = require('./webpack.base.babel')({ ...@@ -22,42 +22,45 @@ module.exports = require('./webpack.base.babel')({
optimization: { optimization: {
minimize: true, minimize: true,
// minimizer: [ minimizer: [
// new TerserPlugin({ new TerserPlugin({
// terserOptions: { terserOptions: {
// warnings: false, warnings: false,
// compress: { compress: {
// comparisons: false, comparisons: false,
// }, drop_console: true,
// parse: {}, drop_debugger: true,
// mangle: true, pure_funcs: ['console.log'], //移除console
// output: { },
// comments: false, parse: {},
// ascii_only: true, mangle: true,
// }, output: {
// }, comments: false,
// parallel: true, ascii_only: true,
// cache: true, },
// sourceMap: true, },
// }), parallel: true,
// ], cache: true,
sourceMap: true,
}),
],
nodeEnv: 'production', nodeEnv: 'production',
sideEffects: true, sideEffects: true,
concatenateModules: true, concatenateModules: true,
runtimeChunk: 'single', runtimeChunk: 'single',
splitChunks: { splitChunks: {
chunks: 'all', chunks: 'all',
// maxInitialRequests: 10, maxInitialRequests: 10,
// minSize: 0, minSize: 0,
// cacheGroups: { cacheGroups: {
// vendor: { vendor: {
// test: /[\\/]node_modules[\\/]/, test: /[\\/]node_modules[\\/]/,
// name(module) { name(module) {
// const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
// return `npm.${packageName.replace('@', '')}`; return `npm.${packageName.replace('@', '')}`;
// }, },
// }, },
// }, },
}, },
}, },
......
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
"@babel/preset-typescript": "^7.12.1", "@babel/preset-typescript": "^7.12.1",
"@babel/runtime": "^7.10.5", "@babel/runtime": "^7.10.5",
"@wisdom-cesium/cesium": "^1.0.78", "@wisdom-cesium/cesium": "^1.0.78",
"@wisdom-map/Amap": "^1.0.49-21", "@wisdom-map/amap": "^1.0.49--27.2",
"@wisdom-map/Map": "^1.0.12-34", "@wisdom-map/basemap": "^1.0.12-43",
"@wisdom-map/arcgismap": "^1.0.79-34", "@wisdom-map/arcgismap": "^1.0.79-43",
"@esri/arcgis-html-sanitizer": "^2.9.0", "@esri/arcgis-html-sanitizer": "^2.9.0",
"@esri/calcite-colors": "6.0.3", "@esri/calcite-colors": "6.0.3",
"ace-builds": "^1.4.12", "ace-builds": "^1.4.12",
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
"stylelint-config-styled-components": "0.1.1", "stylelint-config-styled-components": "0.1.1",
"stylelint-processor-styled-components": "1.6.0", "stylelint-processor-styled-components": "1.6.0",
"svg-url-loader": "2.3.2", "svg-url-loader": "2.3.2",
"terser-webpack-plugin": "1.2.3", "terser-webpack-plugin": "4.2.3",
"url-loader": "1.1.2", "url-loader": "1.1.2",
"webpack": "5.70.0", "webpack": "5.70.0",
"webpack-cli": "4.2.0", "webpack-cli": "4.2.0",
......
...@@ -31,9 +31,7 @@ const logger = { ...@@ -31,9 +31,7 @@ const logger = {
${chalk.bold('Access URLs:')}${divider} ${chalk.bold('Access URLs:')}${divider}
Localhost: ${chalk.magenta(`http://${host}:${port}`)} Localhost: ${chalk.magenta(`http://${host}:${port}`)}
LAN: ${chalk.magenta(`http://${ip.address()}:${port}`) + LAN: ${chalk.magenta(`http://${ip.address()}:${port}`) +
(tunnelStarted (tunnelStarted ? `\n Proxy: ${chalk.magenta(tunnelStarted)}` : '')}${divider}
? `\n Proxy: ${chalk.magenta(tunnelStarted)}`
: '')}${divider}
${chalk.blue(`Press ${chalk.italic('CTRL-C')} to stop`)} ${chalk.blue(`Press ${chalk.italic('CTRL-C')} to stop`)}
`); `);
}, },
......
...@@ -11,9 +11,7 @@ module.exports = function addProdMiddlewares(app, options) { ...@@ -11,9 +11,7 @@ module.exports = function addProdMiddlewares(app, options) {
// and other good practices on official Express.js docs http://mxs.is/googmy // and other good practices on official Express.js docs http://mxs.is/googmy
app.use(compression()); app.use(compression());
app.use(publicPath, express.static(outputPath)); app.use(publicPath, express.static(outputPath));
addProxyMiddleware(app) addProxyMiddleware(app);
app.get('*', (req, res) => app.get('*', (req, res) => res.sendFile(path.resolve(outputPath, 'index.html')));
res.sendFile(path.resolve(outputPath, 'index.html')),
);
}; };
...@@ -9,9 +9,7 @@ const setupProxyFeature = (app, webpackConfig) => { ...@@ -9,9 +9,7 @@ const setupProxyFeature = (app, webpackConfig) => {
webpackConfig.proxy = Object.keys(webpackConfig.proxy).map(context => { webpackConfig.proxy = Object.keys(webpackConfig.proxy).map(context => {
let proxyOptions; let proxyOptions;
// For backwards compatibility reasons. // For backwards compatibility reasons.
const correctedContext = context const correctedContext = context.replace(/^\*$/, '**').replace(/\/\*$/, '');
.replace(/^\*$/, '**')
.replace(/\/\*$/, '');
if (typeof webpackConfig.proxy[context] === 'string') { if (typeof webpackConfig.proxy[context] === 'string') {
proxyOptions = { proxyOptions = {
...@@ -60,9 +58,7 @@ const setupProxyFeature = (app, webpackConfig) => { ...@@ -60,9 +58,7 @@ const setupProxyFeature = (app, webpackConfig) => {
let proxyMiddleware; let proxyMiddleware;
let proxyConfig = let proxyConfig =
typeof proxyConfigOrCallback === 'function' typeof proxyConfigOrCallback === 'function' ? proxyConfigOrCallback() : proxyConfigOrCallback;
? proxyConfigOrCallback()
: proxyConfigOrCallback;
proxyMiddleware = getProxyMiddleware(proxyConfig); proxyMiddleware = getProxyMiddleware(proxyConfig);
...@@ -85,9 +81,7 @@ const setupProxyFeature = (app, webpackConfig) => { ...@@ -85,9 +81,7 @@ const setupProxyFeature = (app, webpackConfig) => {
// - In case the bypass function is defined we'll retrieve the // - In case the bypass function is defined we'll retrieve the
// bypassUrl from it otherwise bypassUrl would be null // bypassUrl from it otherwise bypassUrl would be null
const isByPassFuncDefined = typeof proxyConfig.bypass === 'function'; const isByPassFuncDefined = typeof proxyConfig.bypass === 'function';
const bypassUrl = isByPassFuncDefined const bypassUrl = isByPassFuncDefined ? proxyConfig.bypass(req, res, proxyConfig) : null;
? proxyConfig.bypass(req, res, proxyConfig)
: null;
if (typeof bypassUrl === 'boolean') { if (typeof bypassUrl === 'boolean') {
// skip the proxy // skip the proxy
......
...@@ -25,12 +25,12 @@ const store = configureStore(initialState, history); ...@@ -25,12 +25,12 @@ const store = configureStore(initialState, history);
const MOUNT_NODE = document.getElementById('app'); const MOUNT_NODE = document.getElementById('app');
const render = () => { const render = () => {
ReactDOM.render( ReactDOM.render(
<Provider store = { store }> <Provider store={store}>
<ConnectedRouter history = { history }> <ConnectedRouter history={history}>
<ConfigProvider locale = { zhCN } > <ConfigProvider locale={zhCN}>
{ /* <PictureWallProvider> */ } {/* <PictureWallProvider> */}
<App routesConfig = { config }/> <App routesConfig={config} />
{ /* </PictureWallProvider> */ } {/* </PictureWallProvider> */}
</ConfigProvider> </ConfigProvider>
</ConnectedRouter> </ConnectedRouter>
</Provider>, </Provider>,
......
...@@ -39,9 +39,7 @@ export default appConnector(function App(props) { ...@@ -39,9 +39,7 @@ export default appConnector(function App(props) {
} }
authority={[AUTHORITY.LOGIN]} authority={[AUTHORITY.LOGIN]}
> >
<PictureWallProvider> <PictureWallProvider>{renderRoutes(routesConfig.routes)}</PictureWallProvider>
<Switch>{renderRoutes(routesConfig.routes)}</Switch>
</PictureWallProvider>
</Authozed> </Authozed>
</Router> </Router>
</> </>
......
...@@ -41,9 +41,33 @@ const BasicLayout = props => { ...@@ -41,9 +41,33 @@ const BasicLayout = props => {
}) })
.filter(Boolean); .filter(Boolean);
const handleMenuCollapse = () => {}; // get children authority const handleMenuCollapse = () => {}; // get children authority
// 获取url地址参数
const getQueryVariable = name => {
// 获取url上的参数(使用decodeURIComponent对url参数进行解码)
let search = decodeURIComponent(window.location.search).replace('?', '');
const tempArr = search !== '' ? search.split('&') : [];
// 将参数名转小写,参数值保留原大小写
tempArr.forEach(item => {
if (item) {
const itemArr = item.split('=');
search = search.replace(itemArr[0], itemArr[0].toLowerCase());
}
});
// 正则匹配指定的参数
const reg = new RegExp(`(^|&)${name.toLowerCase()}=([^&]*)(&|$)`);
const result = search.match(reg);
return result != null ? result[2] : '';
};
matchRoutes(props.route.routes, props.location.pathname); matchRoutes(props.route.routes, props.location.pathname);
return ( return (
<>
{getQueryVariable('isSandbox') == 'true' ? (
<>{renderRoutes(props.route.routes)}</>
) : (
<ProLayout <ProLayout
logo={() => <img src={logo} style={{ width: '32px', height: '32px' }} alt="" />} logo={() => <img src={logo} style={{ width: '32px', height: '32px' }} alt="" />}
style={{ height: '100vh' }} style={{ height: '100vh' }}
...@@ -81,6 +105,8 @@ const BasicLayout = props => { ...@@ -81,6 +105,8 @@ const BasicLayout = props => {
> >
{renderRoutes(props.route.routes)} {renderRoutes(props.route.routes)}
</ProLayout> </ProLayout>
)}
</>
); );
}; };
......
...@@ -27,8 +27,17 @@ const AddModal = props => { ...@@ -27,8 +27,17 @@ const AddModal = props => {
if (modalType === 'edit') { if (modalType === 'edit') {
getFormData(); getFormData();
} else { } else {
form.setFieldsValue({ FlowName: title, TimeLimitInt: 0, TimeUnit: '小时' }); form.setFieldsValue({
FlowName: title,
TimeLimit: 0,
TimeUnit: '小时',
TimeLimitField: '(未配置)',
TimeoutField: '(未配置)',
});
} }
} else {
setTimeLimitFlowNodes([]);
setTimeLimitFlowNodesEnd([]);
} }
}, [visible]); }, [visible]);
// 获取到节点后存入当前选中对应的索引用于限制选择节点 // 获取到节点后存入当前选中对应的索引用于限制选择节点
...@@ -205,7 +214,7 @@ const AddModal = props => { ...@@ -205,7 +214,7 @@ const AddModal = props => {
<Form.Item label="默认时限" style={{ marginBottom: 0 }} required> <Form.Item label="默认时限" style={{ marginBottom: 0 }} required>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Form.Item <Form.Item
name="TimeLimitInt" name="TimeLimit"
style={{ marginRight: '18px', width: '100%' }} style={{ marginRight: '18px', width: '100%' }}
rules={[ rules={[
{ required: true, message: '请选填写时限' }, { required: true, message: '请选填写时限' },
......
import React, { useState } from 'react'; import React, { useState, useEffect } from 'react';
import { Card, Tabs } from 'antd'; import { Card, Tabs, Form, Input, Button, notification } from 'antd';
import { CheckOutlined, CloseOutlined } from '@ant-design/icons';
import { SaveMainServer, GetMainServer, DeleteMainServer } from '@/services/database/api';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
import SQLServerTable from './sqlServer/SQLServerTable'; import SQLServerTable from './sqlServer/SQLServerTable';
import OracleTable from './oracle/OracleTable'; import OracleTable from './oracle/OracleTable';
...@@ -31,12 +33,61 @@ const dataArr = [ ...@@ -31,12 +33,61 @@ const dataArr = [
]; ];
const Hr = () => <hr style={{ width: 'calc( 100% - 40px)' }} />; const Hr = () => <hr style={{ width: 'calc( 100% - 40px)' }} />;
const DatabaseConnectConfig = props => { const DatabaseConnectConfig = props => {
const [form] = Form.useForm();
const [flag, setFlag] = useState(false); const [flag, setFlag] = useState(false);
const [active, setActive] = useState('0'); const [active, setActive] = useState('0');
const [isLink, setIsLink] = useState(false); //主站配置是否连接
useEffect(() => {
getData();
}, []);
const handleChange = e => { const handleChange = e => {
setActive(e); setActive(e);
}; };
const getData = () => {
GetMainServer().then(res => {
if (res.code === 0) {
form.setFieldsValue({ url: res.data });
// if (res.data) {
// setIsLink(true);
// form.setFieldsValue({ url: res.data });
// } else {
// setIsLink(false);
// form.setFieldsValue({ url: window.location.origin });
// }
}
});
};
const deleteConfig = () => {
DeleteMainServer().then(res => {
if (res.code === 0) {
notification.success({ message: '提示', duration: 3, description: '删除成功' });
getData();
} else {
notification.error({ message: '提示', duration: 3, description: res.msg });
}
});
};
// 提交主站配置
const onFinish = values => {
console.log('Success:', values);
SaveMainServer(values).then(res => {
if (res.code === 0) {
notification.success({
message: '提示',
duration: 3,
description: '保存成功',
});
getData();
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
return ( return (
<PageContainer> <PageContainer>
...@@ -56,6 +107,45 @@ const DatabaseConnectConfig = props => { ...@@ -56,6 +107,45 @@ const DatabaseConnectConfig = props => {
<MongDBTable /> <MongDBTable />
<MySQLTable /> <MySQLTable />
{/* 主站配置 */}
<div
style={{
fontWeight: 'bold',
fontSize: '16px',
marginLeft: '30x',
marginBottom: '10px',
}}
>
主站配置
</div>
<Form form={form} labelCol={{ span: 1 }} wrapperCol={{ span: 23 }} onFinish={onFinish}>
<Form.Item label="Url地址" required>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Form.Item
name="url"
rules={[
{ required: true, message: '请输入url地址' },
{ type: 'url', message: '请输入完整url' },
]}
style={{ marginBottom: '0', width: '100%' }}
>
<Input placeholder={`如:${window.location.origin}`} />
</Form.Item>
{/* {isLink ? (
<CheckOutlined style={{ margin: '12px 10px 0 10px' }} />
) : (
<CloseOutlined style={{ margin: '12px 10px 0 10px' }} />
)} */}
<Button type="primary" htmlType="submit" style={{ margin: '0 10px' }}>
提交
</Button>
<Button type="primary" onClick={deleteConfig}>
删除
</Button>
</div>
</Form.Item>
</Form>
</Card> </Card>
</PageContainer> </PageContainer>
); );
......
...@@ -34,7 +34,7 @@ const AddModal = props => { ...@@ -34,7 +34,7 @@ const AddModal = props => {
gsUser: obj.user, gsUser: obj.user,
gsWorkspaceName: obj.workname, gsWorkspaceName: obj.workname,
gsPwd: obj.password, gsPwd: obj.password,
serviceName: obj.name, mapServerName: obj.name,
solution: solutionNames, solution: solutionNames,
}; };
publisService(query, { timeout: 120000 }) publisService(query, { timeout: 120000 })
......
...@@ -34,7 +34,7 @@ const VectorPreviewModal = props => { ...@@ -34,7 +34,7 @@ const VectorPreviewModal = props => {
map && map.remove(map.getLayers()); map && map.remove(map.getLayers());
setIsLoading(true); setIsLoading(true);
map && map &&
GetMetaData(metaData.GISServerProjectName).then(res2 => { GetMetaData({ mapServerName: metaData.GISServerProjectName }).then(res2 => {
if (res2 && res2.units) { if (res2 && res2.units) {
setIsLoading(false); setIsLoading(false);
setCurrentMeta(res2); setCurrentMeta(res2);
...@@ -51,7 +51,7 @@ const VectorPreviewModal = props => { ...@@ -51,7 +51,7 @@ const VectorPreviewModal = props => {
}; };
const wmsOption = { const wmsOption = {
tileSize: 512, tileSize: 512,
url: `${location.origin}/Cityinterface/rest/services/MapServer.svc/${ url: `${location.origin}/PandaGIS/MapServer/Export/${
metaData.GISServerProjectName metaData.GISServerProjectName
}/GeoServerProxy/wms`, }/GeoServerProxy/wms`,
blend: false, blend: false,
......
...@@ -147,7 +147,7 @@ const AddModal = props => { ...@@ -147,7 +147,7 @@ const AddModal = props => {
const handleService = value => { const handleService = value => {
form.setFieldsValue({ form.setFieldsValue({
label: value, label: value,
url: `http://{IP}/CityInterface/rest/services/MapServer.svc/${value}`, url: `http://{IP}/PandaGIS/MapServer/Export?mapServerName=${value}`,
}); });
}; };
......
...@@ -166,7 +166,7 @@ const VectorData = props => { ...@@ -166,7 +166,7 @@ const VectorData = props => {
}; };
SetServiceConfig(query) SetServiceConfig(query)
.then(res => { .then(res => {
if (res.code === 0) { if (res.code == 0) {
prompt('success', '关联角色成功'); prompt('success', '关联角色成功');
setFlag(flag + 1); setFlag(flag + 1);
} else { } else {
...@@ -219,7 +219,7 @@ const VectorData = props => { ...@@ -219,7 +219,7 @@ const VectorData = props => {
if (!newLoadings[index]) { if (!newLoadings[index]) {
setServiceType(query).then(res => { setServiceType(query).then(res => {
setCheckLoading(false); setCheckLoading(false);
if (res.IsSuccess) { if (res.code == 0) {
const changehandData = [...webData]; const changehandData = [...webData];
changehandData[index].type = 'dynamic'; changehandData[index].type = 'dynamic';
console.log(changehandData); console.log(changehandData);
...@@ -238,7 +238,7 @@ const VectorData = props => { ...@@ -238,7 +238,7 @@ const VectorData = props => {
type: 'pipenet', type: 'pipenet',
}).then(res => { }).then(res => {
setCheckLoading(false); setCheckLoading(false);
if (res.IsSuccess) { if (res.code == 0) {
const changehandData = [...webData]; const changehandData = [...webData];
changehandData[index].type = 'pipenet'; changehandData[index].type = 'pipenet';
console.log(changehandData); console.log(changehandData);
...@@ -249,7 +249,7 @@ const VectorData = props => { ...@@ -249,7 +249,7 @@ const VectorData = props => {
type: 'dynamic', type: 'dynamic',
}).then(resdata => { }).then(resdata => {
setCheckLoading(false); setCheckLoading(false);
if (resdata.IsSuccess) { if (resdata.code == 0) {
const changehandData1 = [...webData]; const changehandData1 = [...webData];
changehandData1[beforeDefault].type = 'dynamic'; changehandData1[beforeDefault].type = 'dynamic';
console.log(changehandData1); console.log(changehandData1);
...@@ -280,7 +280,7 @@ const VectorData = props => { ...@@ -280,7 +280,7 @@ const VectorData = props => {
if (!newLoadings[index]) { if (!newLoadings[index]) {
setServiceType(query).then(res => { setServiceType(query).then(res => {
setCheckLoading(false); setCheckLoading(false);
if (res.IsSuccess) { if (res.code == 0) {
const changehandData = [...webData]; const changehandData = [...webData];
changehandData[index].type = 'dynamic'; changehandData[index].type = 'dynamic';
// setWebData(changehandData); // setWebData(changehandData);
...@@ -297,7 +297,7 @@ const VectorData = props => { ...@@ -297,7 +297,7 @@ const VectorData = props => {
type: 'pipenet', type: 'pipenet',
}).then(res => { }).then(res => {
setCheckLoading(false); setCheckLoading(false);
if (res.IsSuccess) { if (res.code == 0) {
const changehandData = [...webData]; const changehandData = [...webData];
changehandData[index].type = 'pipenet'; changehandData[index].type = 'pipenet';
// setWebData(changehandData); // setWebData(changehandData);
...@@ -307,7 +307,7 @@ const VectorData = props => { ...@@ -307,7 +307,7 @@ const VectorData = props => {
type: 'dynamic', type: 'dynamic',
}).then(resdata => { }).then(resdata => {
setCheckLoading(false); setCheckLoading(false);
if (resdata.IsSuccess) { if (resdata.code == 0) {
const changehandData1 = [...webData]; const changehandData1 = [...webData];
changehandData1[beforeDefault].type = 'dynamic'; changehandData1[beforeDefault].type = 'dynamic';
// setWebData(changehandData1); // setWebData(changehandData1);
...@@ -379,7 +379,7 @@ const VectorData = props => { ...@@ -379,7 +379,7 @@ const VectorData = props => {
}), }),
}).then(resdata => { }).then(resdata => {
setCheckLoading(false); setCheckLoading(false);
if (resdata.code === 0) { if (resdata.code == 0) {
const changehandData1 = [...handData]; const changehandData1 = [...handData];
changehandData1[beforeDefault].isDefault = false; changehandData1[beforeDefault].isDefault = false;
setHandData(changehandData1); setHandData(changehandData1);
...@@ -446,7 +446,7 @@ const VectorData = props => { ...@@ -446,7 +446,7 @@ const VectorData = props => {
}), }),
}).then(resdata => { }).then(resdata => {
setCheckLoading(false); setCheckLoading(false);
if (resdata.code === 0) { if (resdata.code == 0) {
const changehandData1 = [...handData]; const changehandData1 = [...handData];
changehandData1[beforeDefault].isDefault = false; changehandData1[beforeDefault].isDefault = false;
// setHandData(changehandData1); // setHandData(changehandData1);
......
...@@ -199,3 +199,11 @@ export const InitAddDataBase = params => ...@@ -199,3 +199,11 @@ export const InitAddDataBase = params =>
// 二次初始化 // 二次初始化
export const InitEditDataBase = params => export const InitEditDataBase = params =>
post(`${PUBLISH_SERVICE}/DBManager/InitEditDataBase`, params); post(`${PUBLISH_SERVICE}/DBManager/InitEditDataBase`, params);
// 保存主站配置
export const SaveMainServer = params => get(`${PUBLISH_SERVICE}/DBManager/SaveMainServer`, params);
// 获取主站配置
export const GetMainServer = params => get(`${PUBLISH_SERVICE}/DBManager/GetMainServer`, params);
// 删除主站配置
export const DeleteMainServer = params =>
post(`${PUBLISH_SERVICE}/DBManager/DeleteMainServer`, params);
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index'; import { get, post, PUBLISH_SERVICE, CITY_SERVICE, PANDA_GIS } from '@/services/index';
// 1.获取全部地图方案配置 // 1.获取全部地图方案配置
export const GetAllConfig = param => get(`${CITY_SERVICE}/OMS.svc/GetAllConfig`, param); export const GetAllConfig = param => get(`${CITY_SERVICE}/OMS.svc/GetAllConfig`, param);
// 2.获取元数据 // 2.获取元数据
export const GetMetaData = param => get(`${CITY_SERVICE}/MapServer.svc/${param}`); export const GetMetaData = param => get(`${PANDA_GIS}/Export`, param);
// 3.获取元数据新 // 3.获取元数据新
export const GetMetaDataNew = param => get(`${CITY_SERVICE}/MapServer.svc/${param}`); export const GetMetaDataNew = param => get(`${CITY_SERVICE}/MapServer.svc/${param}`);
......
/*
* @Description:
* @Author: leizhe
* @Date: 2021-12-23 17:51:09
* @LastEditTime: 2022-05-12 18:51:42
* @LastEditors: leizhe
*/
import { request } from '../utils/request'; import { request } from '../utils/request';
const CITY_SERVICE = '/Cityinterface/rest/services'; const CITY_SERVICE = '/Cityinterface/rest/services';
...@@ -13,6 +6,7 @@ const PUBLISH_SERVICE = '/PandaOMS/OMS'; ...@@ -13,6 +6,7 @@ const PUBLISH_SERVICE = '/PandaOMS/OMS';
// export const PUBLISH_SERVICE = '/Publish/GateWay/OMS'; // export const PUBLISH_SERVICE = '/Publish/GateWay/OMS';
const WebSERVICE = '/Publish/Web'; const WebSERVICE = '/Publish/Web';
const CoreSERVICE = '/PandaCore/GCK'; const CoreSERVICE = '/PandaCore/GCK';
const PANDA_GIS = '/PandaGIS/MapServer';
const get = async (url, params, options = {}) => const get = async (url, params, options = {}) =>
request({ request({
url, url,
...@@ -35,4 +29,4 @@ const postForm = async (url, params = {}, options = {}) => { ...@@ -35,4 +29,4 @@ const postForm = async (url, params = {}, options = {}) => {
return post(url, formData, options); return post(url, formData, options);
}; };
export { get, post, postForm, CITY_SERVICE, PUBLISH_SERVICE, WebSERVICE, CoreSERVICE }; export { get, post, postForm, CITY_SERVICE, PUBLISH_SERVICE, WebSERVICE, CoreSERVICE, PANDA_GIS };
import qs from 'qs'; import qs from 'qs';
import axios from 'axios'; import axios from 'axios';
import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index'; import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm, PANDA_GIS } from '../index';
/** /**
* 获取所有网站配置 * 获取所有网站配置
...@@ -162,18 +162,18 @@ export const GetGISServerMapList = query => ...@@ -162,18 +162,18 @@ export const GetGISServerMapList = query =>
// 发布原数据 // 发布原数据
export const publisService = (query, timeout) => export const publisService = (query, timeout) =>
get(`${CITY_SERVICE}/OMS.svc/D_Publish_GS_Service`, query, timeout); get(`${PANDA_GIS}/MetaData/D_Publish_GS_Service`, query, timeout);
// 解决方案名称 // 解决方案名称
export const getSolutionList = query => get(`${CITY_SERVICE}/OMS.svc/W4_GetSolutionList`, query); export const getSolutionList = query => get(`${PANDA_GIS}/MetaData/W5_GetSolutionList`, query);
// 删除元数据 // 删除元数据
export const deleteVectorService = query => export const deleteVectorService = query =>
get(`${CITY_SERVICE}/OMS.svc/D_DeleteVectorService`, query); get(`${PANDA_GIS}/MetaData/D_DeleteVectorService`, query);
// 更新元数据 // 更新元数据
export const updatePublishedMetaData = query => export const updatePublishedMetaData = query =>
get(`${CITY_SERVICE}/OMS.svc/D_UpdatePublishedMetaData`, query); get(`${PANDA_GIS}/MetaData/D_UpdatePublishedMetaData`, query);
// 删除配置 // 删除配置
export const deleteConfig = query => get(`${PUBLISH_SERVICE}/Maplayer/DeletMaplayer`, query); export const deleteConfig = query => get(`${PUBLISH_SERVICE}/Maplayer/DeletMaplayer`, query);
...@@ -187,7 +187,7 @@ export const unbindSchemeBaseMap = query => ...@@ -187,7 +187,7 @@ export const unbindSchemeBaseMap = query =>
get(`${PUBLISH_SERVICE}/Maplayer/UnBindSchemeBaseMap`, query); get(`${PUBLISH_SERVICE}/Maplayer/UnBindSchemeBaseMap`, query);
// 设置web状态 // 设置web状态
export const setServiceType = query => get(`${CITY_SERVICE}/OMS.svc/SetServiceType`, query); export const setServiceType = query => get(`${PANDA_GIS}/MetaData/SetServiceType`, query);
// 获取角色 // 获取角色
export const getUserRelationList = query => export const getUserRelationList = query =>
......
import RenderAuthorize from '@/components/Authorized'; import RenderAuthorize from '@/components/Authorized/index.jsx';
import { isDev } from './tools.ts'; import { isDev } from './tools.ts';
// const isDev = false; // const isDev = false;
let auth = []; let auth = [];
/* eslint-disable eslint-comments/disable-enable-pair */ /* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable import/no-mutable-exports */ /* eslint-disable import/no-mutable-exports */
// 获取url地址参数
const getQueryVariable = name => {
// 获取url上的参数(使用decodeURIComponent对url参数进行解码)
let search = decodeURIComponent(window.location.search).replace('?', '');
const tempArr = search !== '' ? search.split('&') : [];
// 将参数名转小写,参数值保留原大小写
tempArr.forEach(item => {
if (item) {
const itemArr = item.split('=');
search = search.replace(itemArr[0], itemArr[0].toLowerCase());
}
});
// 正则匹配指定的参数
const reg = new RegExp(`(^|&)${name.toLowerCase()}=([^&]*)(&|$)`);
const result = search.match(reg);
return result != null ? result[2] : '';
};
console.log(getAuthority(), 'getAuthority()');
let Authorized = RenderAuthorize(getAuthority()); let Authorized = RenderAuthorize(getAuthority());
// Reload the rights component // Reload the rights component
...@@ -22,7 +43,16 @@ export default Authorized; ...@@ -22,7 +43,16 @@ export default Authorized;
// use localStorage to store the authority info, which might be sent from server in actual project. // use localStorage to store the authority info, which might be sent from server in actual project.
export function getAuthority(str) { export function getAuthority(str) {
if (!isDev) return [...auth]; const isSandBox = getQueryVariable('isSandbox');
if (!isDev) {
// return [...auth];
// 支持可以指直接访问
if (isSandBox == 'true') {
return ['LOGIN', 'admin'];
} else {
return [...auth];
}
}
const authorityString = const authorityString =
typeof str === 'undefined' && localStorage ? localStorage.getItem('panda-oms-authority') : str; typeof str === 'undefined' && localStorage ? localStorage.getItem('panda-oms-authority') : str;
// authorityString could be admin, "admin", ["admin"] // authorityString could be admin, "admin", ["admin"]
......
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