对接友情链接
This commit is contained in:
@ -7,7 +7,7 @@ export default {
|
|||||||
// },
|
// },
|
||||||
'/api': {
|
'/api': {
|
||||||
// target: 'http://10.242.37.148:18022',//连接天宫的ng
|
// 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,
|
changeOrigin: true,
|
||||||
pathRewrite: { '^/api': '' },
|
pathRewrite: { '^/api': '' },
|
||||||
},
|
},
|
||||||
|
@ -1,14 +1,30 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
const LinkComponent: React.FC = () => {
|
import { Select } from 'antd';
|
||||||
|
|
||||||
|
const LinkComponent: React.FC<{ links: API.CoscoPortalsLinksClassification }> = ({ links }) => {
|
||||||
|
console.log(links);
|
||||||
return (
|
return (
|
||||||
<div className="link">
|
<div className="link">
|
||||||
<div>友情链接</div>
|
<div>友情链接</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<a href="https://www.baidu.com">百度</a>
|
{links.map((link) => (
|
||||||
<a href="https://www.baidu.com">百度</a>
|
<>
|
||||||
<a href="https://www.baidu.com">百度</a>
|
{link.links.length > 0 && (
|
||||||
<a href="https://www.baidu.com">百度</a>
|
<Select
|
||||||
<a href="https://www.baidu.com">百度</a>
|
style={{ width: 200 }}
|
||||||
|
size="small"
|
||||||
|
placeholder={link.name}
|
||||||
|
options={link.links.map((item) => ({
|
||||||
|
label: item.name,
|
||||||
|
value: item.url,
|
||||||
|
}))}
|
||||||
|
onChange={(value) => {
|
||||||
|
window.open(value as string, '_blank');
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
.link {
|
.link {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
align-items: center;
|
||||||
.flex {
|
.flex {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -8,6 +8,7 @@ import { getCoscoPortalsLinksClassification } from '@/servers/api';
|
|||||||
const IndexPage: React.FC = () => {
|
const IndexPage: React.FC = () => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const [noticeLoading, setNoticeLoading] = useState(false);
|
const [noticeLoading, setNoticeLoading] = useState(false);
|
||||||
|
const [links, setLinks] = useState<API.CoscoPortalsLinksClassification>([]);
|
||||||
const [noticeList, setNoticeList] = useState([
|
const [noticeList, setNoticeList] = useState([
|
||||||
{
|
{
|
||||||
title: 'CA使用通知',
|
title: 'CA使用通知',
|
||||||
@ -155,7 +156,8 @@ const IndexPage: React.FC = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getCoscoPortalsLinksClassification().then((res) => {
|
getCoscoPortalsLinksClassification().then((res) => {
|
||||||
console.log(res);
|
setLinks(res.data);
|
||||||
|
console.log(res.data);
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -249,7 +251,7 @@ const IndexPage: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<LinkComponent />
|
<LinkComponent links={links} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
export async function getCoscoPortalsLinksClassification() {
|
export async function getCoscoPortalsLinksClassification() {
|
||||||
return request<API.APIResponse<API.HelpCenterListResponse>>('/homePage/coscoPortalsLinksClassification/getAll', {
|
return request<API.APIResponse<API.CoscoPortalsLinksClassification>>('/homePage/coscoPortalsLinksClassification/getAll', {
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
27
src/servers/api/typings.d.ts
vendored
27
src/servers/api/typings.d.ts
vendored
@ -341,4 +341,31 @@ declare namespace API {
|
|||||||
updateTime: string;
|
updateTime: string;
|
||||||
[property: string]: any;
|
[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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user