Commit f7db64cf authored by 李纪文's avatar 李纪文

feat: globalConfig增加mainserver配置

parent ac99e46e
Pipeline #95137 passed with stages
......@@ -120,9 +120,9 @@
"@wisdom-map/util":"1.2.9",
"@wisdom-map/gis-utils": "1.0.17",
"@wisdom-map/pd-map": "1.0.100",
"@wisdom-utils/components": "0.1.375",
"@wisdom-utils/components": "0.1.376",
"@wisdom-utils/runtime": "0.0.51",
"@wisdom-utils/utils": "0.1.411",
"@wisdom-utils/utils": "0.1.412",
"animate.css": "^4.1.1",
"antd": "4.21.2",
"bcryptjs": "2.4.3",
......
......@@ -6,6 +6,7 @@ export const API = {
CHECK_FREE_LOGIN: '/PandaOMS/OMS/CheckFreeLogin',
GET_GATEWAY_CONFIG: '/PandaOMS/OMS/HostManager/GetGateWay',
GET_CONFIG: '/PandaOMS/OMS/WebSite/GetConfig',
GET_MAIN_SERVER: '/PandaOMS/OMS/DBManager/GetMainServer',
GENERATE_TOKEN: '/PandaCore/GCK/BussinessAuth/GenerateToken',
GENERATE_IOT_TOKEN: '/PandaCore/GCK/BussinessAuth/GenerateTokenGCK',
GENERATE_QRCODE: 'cityinterface/rest/services.svc/generatetokenByqrcode',
......@@ -124,6 +125,11 @@ const services = {
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
getMainServer: {
url: API.GET_MAIN_SERVER,
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
generatetokenByqrcode: {
url: API.GENERATE_QRCODE,
method: constants.REQUEST_METHOD_GET,
......
......@@ -129,7 +129,7 @@ export const AppInitState = () => {
client: client || 'city',
ignoreSite: true,
})
.then(res => {
.then(async res => {
if (res) {
const { data } = res;
if (!data.client) {
......@@ -149,6 +149,10 @@ export const AppInitState = () => {
if (data.webState === '1' || data.webState === '3') {
data.isIntegration = '1';
}
const serverRes = await appService.getMainServer();
const serverData = serverRes?.data || [];
const mainserverConf = serverData.find(item => item.name === 'mainserver');
const mainserver = mainserverConf?.url || '';
store.dispatch(
actionCreators.getConfig(
Object.assign(
......@@ -159,6 +163,9 @@ export const AppInitState = () => {
access_token: '',
userInfo: null,
},
{
mainserver,
},
gateWayConfig,
),
),
......@@ -190,6 +197,9 @@ export const AppInitState = () => {
{
token: getToken(),
},
{
mainserver,
},
gateWayConfig,
),
createContext: value => store.dispatch(actionCreators.createContext(value)),
......
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