From 5d5dc9a7978dda94b5a9a16ae2a859177dc038ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E9=98=B3?= Date: Fri, 22 Nov 2024 15:49:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=20LinkType=20->=20WebType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Web.ts | 6 +++--- src/pages/Web/index.tsx | 12 ++++++------ src/types/app/web.d.ts | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/api/Web.ts b/src/api/Web.ts index 726fd68..6df046f 100644 --- a/src/api/Web.ts +++ b/src/api/Web.ts @@ -1,5 +1,5 @@ import Request from '@/utils/request' -import { Web, LinkType } from '@/types/app/web' +import { Web, WebType } from '@/types/app/web' import { getListAPI } from '@/utils' // 新增网站 @@ -32,8 +32,8 @@ export const getLinkPagingAPI = (data?: QueryData) => Request>(" }) // 获取网站类型列表 -export const getLinkTypeListAPI = () => { - return Request("GET", `/link/type`); +export const getWebTypeListAPI = () => { + return Request("GET", `/link/type`); }; // 审核网站 diff --git a/src/pages/Web/index.tsx b/src/pages/Web/index.tsx index 7e4e445..4281636 100644 --- a/src/pages/Web/index.tsx +++ b/src/pages/Web/index.tsx @@ -1,8 +1,8 @@ import { useState, useEffect } from 'react'; import { Tabs, Input, Button, Form, Spin, Empty, Card, Popconfirm, Select, message } from 'antd'; import { SearchOutlined } from '@ant-design/icons'; -import { getLinkListAPI, addLinkDataAPI, editLinkDataAPI, delLinkDataAPI, getLinkTypeListAPI } from '@/api/Web'; -import { LinkType, Web } from '@/types/app/web'; +import { getLinkListAPI, addLinkDataAPI, editLinkDataAPI, delLinkDataAPI, getWebTypeListAPI } from '@/api/Web'; +import { WebType, Web } from '@/types/app/web'; import Title from '@/components/Title'; import { RuleObject } from 'antd/es/form'; import './index.scss'; @@ -14,7 +14,7 @@ const LinkPage = () => { const [tab, setTab] = useState('list'); const [list, setList] = useState([]); const [listTemp, setListTemp] = useState([]); - const [typeList, setTypeList] = useState([]); + const [typeList, setTypeList] = useState([]); const [search, setSearch] = useState(''); const [link, setLink] = useState({} as Web); @@ -33,15 +33,15 @@ const LinkPage = () => { }; // 获取网站类型列表 - const getLinkTypeList = async () => { - const { data } = await getLinkTypeListAPI(); + const getWebTypeList = async () => { + const { data } = await getWebTypeListAPI(); setTypeList(data); }; useEffect(() => { setLoading(true); getLinkList(); - getLinkTypeList(); + getWebTypeList(); }, []); useEffect(() => { diff --git a/src/types/app/web.d.ts b/src/types/app/web.d.ts index b693101..0a3c8ef 100644 --- a/src/types/app/web.d.ts +++ b/src/types/app/web.d.ts @@ -1,4 +1,4 @@ -export interface LinkType { +export interface WebType { id: number, name: string, order: number @@ -14,7 +14,7 @@ export interface Web { rss: string, order: number, typeId: number, - type: LinkType, + type: WebType, auditStatus: number, createTime?: string }