Commit 26ef2629 authored by mayongxin's avatar mayongxin

宿主管理接口替换

parent 55e0f46b
Pipeline #24261 skipped with stages
import React, { useState, useEffect } from 'react' import React, { useState, useEffect } from 'react'
import { Card } from 'antd' import { Card } from 'antd'
import styles from './BaseConfig.less' import styles from './BaseConfig.less'
import { S_GetDataBaseConfig, GetTCPConfigInfo } from '../../../../services/platform/hostmanager' import { S_GetDataBaseConfig, GetTCPConfigInfo,GetDataBaseConfig,GetBasicInfo } from '../../../../services/platform/hostmanager'
...@@ -9,7 +10,7 @@ const BaseConfig = () => { ...@@ -9,7 +10,7 @@ const BaseConfig = () => {
const [currentDataBase, setCurrentDataBase] = useState({}); const [currentDataBase, setCurrentDataBase] = useState({});
const [currentSiteInfo, setcurrentSiteInfo] = useState({getMe:[{SiteCode:""}]}); const [currentSiteInfo, setcurrentSiteInfo] = useState("");
useEffect(() => { useEffect(() => {
...@@ -18,25 +19,39 @@ const BaseConfig = () => { ...@@ -18,25 +19,39 @@ const BaseConfig = () => {
},[]) },[])
const getCurrentConfig = () => { const getCurrentConfig = () => {
S_GetDataBaseConfig({ // S_GetDataBaseConfig({
_version: 9999, // _version: 9999,
_dc: new Date().getTime(), // _dc: new Date().getTime(),
}).then( // }).then(
res => { // res => {
if (res.success === true) { // if (res.success === true) {
setCurrentDataBase(res) // setCurrentDataBase(res)
// }
// }
// )
GetDataBaseConfig().then(
res =>{
if(res.code === 0){
setCurrentDataBase(res.data)
} }
} }
) )
} }
const getSiteCode = () => { const getSiteCode = () => {
GetTCPConfigInfo({ // GetTCPConfigInfo({
_version: 9999, // _version: 9999,
_dc: new Date().getTime(), // _dc: new Date().getTime(),
}).then( // }).then(
res => { // res => {
if (res.say.statusCode === '0000') { // if (res.say.statusCode === '0000') {
setcurrentSiteInfo(res) // setcurrentSiteInfo(res)
// }
// }
// )
GetBasicInfo().then(
res =>{
if(res.code === 0 ){
setcurrentSiteInfo(res.data)
} }
} }
) )
...@@ -62,7 +77,7 @@ const BaseConfig = () => { ...@@ -62,7 +77,7 @@ const BaseConfig = () => {
</Card> </Card>
<Card title="站点信息" style={{ width: 300, marginLeft: 15 }}> <Card title="站点信息" style={{ width: 300, marginLeft: 15 }}>
<Card type="inner" title="站点编号" style={{ margin: 10 }}> <Card type="inner" title="站点编号" style={{ margin: 10 }}>
{currentSiteInfo.getMe[0].SiteCode} {currentSiteInfo}
</Card> </Card>
</Card> </Card>
</div> </div>
......
...@@ -5,4 +5,8 @@ export const S_GetDataBaseConfig = param => ...@@ -5,4 +5,8 @@ export const S_GetDataBaseConfig = param =>
get(`${CITY_SERVICE}/OMS.svc/S_GetDataBaseConfig`, param); get(`${CITY_SERVICE}/OMS.svc/S_GetDataBaseConfig`, param);
export const GetTCPConfigInfo = param => export const GetTCPConfigInfo = param =>
get(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/GetTCPConfigInfo`, param); get(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/GetTCPConfigInfo`, param);
\ No newline at end of file export const GetDataBaseConfig = param =>
get(`${PUBLISH_SERVICE}/DBManager/GetDataBaseConfig`, param);
export const GetBasicInfo = param =>
get(`${PUBLISH_SERVICE}/Message/GetBasicInfo`, param);
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