Browse Source

大屏水务数据用api地址

master
liujiangyong 1 year ago
parent
commit
7f2e6683b9
  1. 2
      api/.vscode/launch.json
  2. 4
      api/config.js
  3. 7
      super-screen/client/src/sections/water-prevention/containers/homePage.js
  4. 25
      super-screen/client/src/utils/webapi.js
  5. 8
      super-screen/config.js
  6. 2
      super-screen/package.json

2
api/.vscode/launch.json

@ -20,7 +20,7 @@
"-b http://10.8.30.161:31420",
"-s http://10.8.30.161:32258",
"-d postgres/example/10.8.30.160/30432",
"-w https://waterconservancy.anxinyun.cn",
"-w https://smartwater.anxinyun.cn",
"-a https://smartworksafety.anxinyun.cn",
]
},

4
api/config.js

@ -13,8 +13,8 @@ args.option(['g', 'pg'], 'postgre 服务 URL');
args.option(['b', 'backups'], '后端数据库备份恢复接口地址');
args.option(['s', 'kubesphere'], 'kubesphere地址');
args.option(['d', 'dbconfig'], '后台同步数据库host示例:postgres/example/10.8.30.160/30432 格式:用户名/密码/host/port');
args.option(['w', 'water'], '水环境地址');
args.option(['a', 'worksafety'], '安监地址');
args.option(['w', 'water'], '水环境api地址');
args.option(['a', 'worksafety'], '安监api地址');
const flags = args.parse(process.argv);

7
super-screen/client/src/sections/water-prevention/containers/homePage.js

@ -14,6 +14,7 @@ import Weather from '../components/weather'
import Gis from './gis';
import moment from 'moment';
import './style.less'
import { RouteRequest } from '@peace/utils';
function homePage(props) {
const { dispatch, actions } = props;
@ -45,9 +46,9 @@ function homePage(props) {
const getData = () => {
// 水务
dispatch(getPcode()).then(res => {
if (res.success) {
dispatch(waterLogin({ username: "123456", password: "123456", pcode: res.payload.data.pcode })).then(loginRes => {
RouteRequest.get(`/_waterweb/get/pcode`).then((res) => {
if (res.pcode) {
dispatch(waterLogin({ username: "123456", password: "123456", pcode: res.pcode })).then(loginRes => {
if (loginRes.success) {
const { token } = loginRes.payload.data;
sessionStorage.setItem('waterUser', JSON.stringify(loginRes.payload.data));

25
super-screen/client/src/utils/webapi.js

@ -117,20 +117,19 @@ export const ApiTable = {
lookField: 'lookField',
//大屏-水务
getPcode: '_water/get/pcode',
waterLogin: '_water/_api/login',
getWaterLevelTrend: '_water/_api/overview/monitoring-station',
getWaterStructures: '_water/_api/organizations/84/structures',
getWaterVideoList: '_water/_api/structures/{struIds}/ipcs?stationIds=undefined',
getYsAccessToken: '_water/_api/yingshi/accessToken',
getWaterAlarms: '_water/_api/axy/alarm?userId=1134&orderBy=endTime&orderDirection=desc&limit=10&offset=0',
waterLogin: '_water/api/login',
getWaterLevelTrend: '_water/api/overview/monitoring-station',
getWaterStructures: '_water/api/organizations/84/structures',
getWaterVideoList: '_water/api/structures/{struIds}/ipcs?stationIds=undefined',
getYsAccessToken: '_water/api/yingshi/accessToken',
getWaterAlarms: '_water/api/axy/alarm?userId=1134&orderBy=endTime&orderDirection=desc&limit=10&offset=0',
//安监
worksafetyLogin: '_worksafety/_api/project/login',
getEmerOrgList: '_worksafety/_api/emergency/resource-org-list', // 应急机构
getEmerTeamList: '_worksafety/_api/emergency/resource-team-list', // 应急队伍
getEmerExpertList: '_worksafety/_api/emergency/resource-expert-list', // 应急专家
getEmerMedicalList: '_worksafety/_api/emergency/resource-medical-list', // 医疗机构
getEmerRefugeList: '_worksafety/_api/emergency/resource-refuge-list', // 避难场所
worksafetyLogin: '_worksafety/api/project/login',
getEmerOrgList: '_worksafety/api/emergency/resource-org-list', // 应急机构
getEmerTeamList: '_worksafety/api/emergency/resource-team-list', // 应急队伍
getEmerExpertList: '_worksafety/api/emergency/resource-expert-list', // 应急专家
getEmerMedicalList: '_worksafety/api/emergency/resource-medical-list', // 医疗机构
getEmerRefugeList: '_worksafety/api/emergency/resource-refuge-list', // 避难场所
};
export const RouteTable = {

8
super-screen/config.js

@ -14,6 +14,7 @@ dev && console.log('\x1B[33m%s\x1b[0m', '请遵循并及时更新 readme.md,维
// // 启动参数
args.option(['p', 'port'], '启动端口');
args.option(['u', 'api-url'], 'webapi的URL');
args.option(['w', 'waterweb'], '水环境web地址');
args.option('qnak', 'qiniuAccessKey');
args.option('qnsk', 'qiniuSecretKey');
args.option('qnbkt', 'qiniuBucket');
@ -26,6 +27,7 @@ const ANXINCLOUD_QINIU_ACCESSKEY = process.env.ANXINCLOUD_QINIU_ACCESSKEY || fla
const ANXINCLOUD_QINIU_SECRETKEY = process.env.ANXINCLOUD_QINIU_SECRETKEY || flags.qnsk;
const ANXINCLOUD_QINIU_BUCKET_RESOURCE = process.env.ANXINCLOUD_QINIU_BUCKET_RESOURCE || flags.qnbkt;
const ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE || flags.qndmn;
const WATER_WEB_URL = process.env.WATER_WEB_URL || flags.waterweb;
const weatherUrl = process.env.ANXINCLOUD_WEATHERAPP_API || "https://weatherssj.anxinyun.cn/weatherApp/weather/getImmeData"
//阿里OSS
@ -56,6 +58,12 @@ const product = {
host: FS_UNIAPP_API,
match: /^\/_api\//,
}
}, {
entry: require('./middlewares/proxy').entry,
opts: {
host: WATER_WEB_URL,
match: /\/_waterweb\//,
}
},
// {
// entry: require('./middlewares/attachment').entry,

2
super-screen/package.json

@ -6,7 +6,7 @@
"scripts": {
"test": "mocha",
"start": "cross-env NODE_ENV=development npm run start-params",
"start-params": "node server -p 5500 -u http://localhost:4400",
"start-params": "node server -p 5500 -u http://localhost:4400 -w https://waterconservancy.anxinyun.cn",
"deploy": "export NODE_ENV=production && npm run build && node server",
"build-dev": "set NODE_ENV=development&&webpack --config webpack.config.js",
"build": "set NODE_ENV=production&&webpack --config webpack.config.prod.js"

Loading…
Cancel
Save