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

fix: '网关配置'

parent fedbacf1
Pipeline #54977 passed with stages
...@@ -66,6 +66,16 @@ const GateConfig = () => { ...@@ -66,6 +66,16 @@ const GateConfig = () => {
useEffect(() => { useEffect(() => {
if (currentConfig) { if (currentConfig) {
localStorage.setItem('panda-publish', 'getway'); localStorage.setItem('panda-publish', 'getway');
GetReRoutes({
UpstreamPathTemplate: '',
key: '',
}).then(res => {
setLoading(false);
if (res.code === 0) {
console.log(res.data);
setTableData(res.data);
}
});
} else { } else {
localStorage.setItem('panda-publish', ''); localStorage.setItem('panda-publish', '');
} }
...@@ -79,32 +89,22 @@ const GateConfig = () => { ...@@ -79,32 +89,22 @@ const GateConfig = () => {
} }
}); });
setLoading(true); setLoading(true);
GetReRoutesFirst({
UpstreamPathTemplate: '', // .catch(err => {
key: '', // setLoading(false);
}) // GetReRoutes({
.then(res => { // UpstreamPathTemplate: '',
setLoading(false); // key: '',
if (res.code === 0) { // }).then(resdata => {
console.log(res.data); // setLoading(false);
setTableData(res.data); // if (resdata.code === 0) {
} // console.log(resdata.data);
}) // setTableData(resdata.data);
.catch(err => { // } else {
setLoading(false); // console.log(123);
GetReRoutes({ // }
UpstreamPathTemplate: '', // });
key: '', // });
}).then(resdata => {
setLoading(false);
if (resdata.code === 0) {
console.log(resdata.data);
setTableData(resdata.data);
} else {
console.log(123);
}
});
});
}, [flag]); }, [flag]);
const columns = [ const columns = [
......
...@@ -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-07-08 16:37:26 * @LastEditTime: 2022-07-08 17:45:40
* @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,7 @@ export const ReloadNginx = param => get(`${PUBLISH_SERVICE}/HostManager/ReloadNg ...@@ -40,7 +40,7 @@ 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 GetReRoutesFirst = param => get(`${PandaCore}/OcelotSettings/GetReRoutes`, param); // export const GetReRoutesFirst = param => get(`/OcelotSettings/GetReRoutes`, param);
export const GetReRoutes = param => get(`/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