调整:类型 LinkType -> WebType

This commit is contained in:
宇阳
2024-11-22 15:49:17 +08:00
parent bb2d4fdeec
commit 5d5dc9a797
3 changed files with 11 additions and 11 deletions

View File

@@ -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<Paginate<Web[]>>("
})
// 获取网站类型列表
export const getLinkTypeListAPI = () => {
return Request<LinkType[]>("GET", `/link/type`);
export const getWebTypeListAPI = () => {
return Request<WebType[]>("GET", `/link/type`);
};
// 审核网站

View File

@@ -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<string>('list');
const [list, setList] = useState<Web[]>([]);
const [listTemp, setListTemp] = useState<Web[]>([]);
const [typeList, setTypeList] = useState<LinkType[]>([]);
const [typeList, setTypeList] = useState<WebType[]>([]);
const [search, setSearch] = useState<string>('');
const [link, setLink] = useState<Web>({} 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(() => {

View File

@@ -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
}