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

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

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