Commit ac3fd6c8 authored by 皮倩雯's avatar 皮倩雯

fix: '网关配置获取数据接口路径问题导致只有第一次能获取数据问题修复'

parent 91fa20e1
Pipeline #54967 passed with stages
/* eslint-disable no-unused-expressions */
/* eslint-disable no-else-return */
import React, { useEffect, useState } from 'react';
import {
......@@ -29,6 +30,7 @@ import {
GetGateWay,
UpdateGeteWay,
GetReRoutes,
GetReRoutesFirst,
DelRoutes,
} from '@/services/hostmanager/hostmanager';
import configuration from '../../../../assets/images/icons/消息.svg';
......@@ -83,7 +85,21 @@ const GateConfig = () => {
}).then(res => {
setLoading(false);
if (res.code === 0) {
console.log(res.data);
setTableData(res.data);
} else {
GetReRoutesFirst({
UpstreamPathTemplate: '',
key: '',
}).then(resdata => {
setLoading(false);
if (resdata.code === 0) {
console.log(resdata.data);
setTableData(resdata.data);
} else {
console.log(123);
}
});
}
});
}, [flag]);
......@@ -175,6 +191,22 @@ const GateConfig = () => {
}
},
},
{
title: '优先级',
dataIndex: 'priority',
key: 'priority',
align: 'center',
render: (text, record) => {
console.log(text);
return (
<span>
<Tooltip placement="top" title={text}>
{text}
</Tooltip>
</span>
);
},
},
{
title: '操作',
key: 'action',
......
......@@ -2,7 +2,7 @@
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-06-23 16:42:21
* @LastEditTime: 2022-07-08 16:37:26
* @LastEditors: leizhe
*/
import { get, post, PUBLISH_SERVICE, CITY_SERVICE, PandaCore } from '@/services/index';
......@@ -40,7 +40,8 @@ export const ReloadNginx = param => get(`${PUBLISH_SERVICE}/HostManager/ReloadNg
export const GetGateWay = param => get(`${PUBLISH_SERVICE}/HostManager/GetGateWay`, param);
export const UpdateGeteWay = param => get(`${PUBLISH_SERVICE}/HostManager/UpdateGeteWay`, param);
// 网关配置
export const GetReRoutes = param => get(`${PandaCore}/OcelotSettings/GetReRoutes`, param);
export const GetReRoutesFirst = param => get(`${PandaCore}/OcelotSettings/GetReRoutes`, param);
export const GetReRoutes = param => get(`/OcelotSettings/GetReRoutes`, param);
export const SaveRoutes = param => post(`/OcelotSettings/SaveRoutes`, param);
export const DelRoutes = param => get(`/OcelotSettings/DelRoutes`, 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