diff --git a/config/proxy.ts b/config/proxy.ts
index 62211ad..53474f3 100644
--- a/config/proxy.ts
+++ b/config/proxy.ts
@@ -7,7 +7,7 @@ export default {
// },
'/api': {
// target: 'http://10.242.37.148:18022',//连接天宫的ng
- target: 'http://10.0.0.14:18013',//连接天宫的ng
+ target: 'http://10.0.0.10:18013',//连接天宫的ng
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
diff --git a/src/pages/index/Link.tsx b/src/pages/index/Link.tsx
index 567b11c..3a3c16c 100644
--- a/src/pages/index/Link.tsx
+++ b/src/pages/index/Link.tsx
@@ -1,14 +1,30 @@
import React from 'react';
-const LinkComponent: React.FC = () => {
+import { Select } from 'antd';
+
+const LinkComponent: React.FC<{ links: API.CoscoPortalsLinksClassification }> = ({ links }) => {
+ console.log(links);
return (
友情链接
-
百度
-
百度
-
百度
-
百度
-
百度
+ {links.map((link) => (
+ <>
+ {link.links.length > 0 && (
+
);
diff --git a/src/pages/index/index.less b/src/pages/index/index.less
index 1a528f6..16ee2b4 100644
--- a/src/pages/index/index.less
+++ b/src/pages/index/index.less
@@ -42,6 +42,7 @@
.link {
display: flex;
margin-top: 10px;
+ align-items: center;
.flex {
margin-left: 10px;
display: flex;
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index 4cde935..7c59f1c 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -8,6 +8,7 @@ import { getCoscoPortalsLinksClassification } from '@/servers/api';
const IndexPage: React.FC = () => {
const intl = useIntl();
const [noticeLoading, setNoticeLoading] = useState(false);
+ const [links, setLinks] = useState([]);
const [noticeList, setNoticeList] = useState([
{
title: 'CA使用通知',
@@ -155,7 +156,8 @@ const IndexPage: React.FC = () => {
useEffect(() => {
getCoscoPortalsLinksClassification().then((res) => {
- console.log(res);
+ setLinks(res.data);
+ console.log(res.data);
});
}, []);
@@ -249,7 +251,7 @@ const IndexPage: React.FC = () => {
-
+
);
diff --git a/src/servers/api/index.ts b/src/servers/api/index.ts
index 4667f7c..8da9ec9 100644
--- a/src/servers/api/index.ts
+++ b/src/servers/api/index.ts
@@ -2,7 +2,7 @@
import request from '@/utils/request';
export async function getCoscoPortalsLinksClassification() {
- return request>('/homePage/coscoPortalsLinksClassification/getAll', {
+ return request>('/homePage/coscoPortalsLinksClassification/getAll', {
method: 'get',
});
}
diff --git a/src/servers/api/typings.d.ts b/src/servers/api/typings.d.ts
index ff7fd20..9847e44 100644
--- a/src/servers/api/typings.d.ts
+++ b/src/servers/api/typings.d.ts
@@ -341,4 +341,31 @@ declare namespace API {
updateTime: string;
[property: string]: any;
}
+
+ export type CoscoPortalsLinksClassification = {
+ id: string;
+ name: string;
+ nameEn: string;
+ links: CoscoPortalsLinks[];
+ }[]
+ export type CoscoPortalsLinks = {
+ basePageRequest: null;
+ classificationId: string;
+ createBy: string;
+ createDate: null;
+ createTime: string;
+ delFlag: string;
+ deleteFlag: null;
+ id: string;
+ lastUpdateTime: null;
+ name: string;
+ nameEn: string;
+ orderBy: string;
+ remark: null;
+ status: string;
+ tenantId: null;
+ tenantName: null;
+ thumbnail: string;
+ url: string;
+ }
}