jihuaqiang před 1 měsícem
rodič
revize
82d27d2113

+ 0 - 1
src/views/messages/messages.router.tsx

@@ -2,7 +2,6 @@ import Icon, { MessageOutlined } from '@ant-design/icons'
 import { AdminRouterItem } from "../../router";
 import React, { Suspense } from 'react';
 import LogoIcon from "@src/assets/images/login/logo.svg?react";
-import { Badge } from 'antd';
 
 // Lazy load components
 const Messages = React.lazy(() => import('./messages.tsx'));

+ 1 - 4
src/views/messages/messages.tsx

@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from 'react'
+import { useEffect, useState } from 'react'
 import { Button, Pagination } from 'antd'
 import { getNoticeList, readAllNotice, readNotice } from '@src/http/api'
 import request from '@src/http'
@@ -23,7 +23,6 @@ const Messages = () => {
 	const notReadMessageCount = useMessageStore(state => state.notReadMessageCount)
 	const setNotReadMessageCount = useMessageStore(state => state.setNotReadMessageCount)
 	const [messages, setMessages] = useState<Message[]>([])
-	const [loading, setLoading] = useState(false)
 	const [page, setPage] = useState(1)
 	const [total, setTotal] = useState(0)
 
@@ -32,7 +31,6 @@ const Messages = () => {
 	}, [page])
 
 	const getMessages = async () => {
-		setLoading(true)
 		const response = await request.post<{ objs: Message[], totalSize	: number }>(getNoticeList,{
 			pageNum: page,
 			pageSize: PAGE_SIZE,
@@ -40,7 +38,6 @@ const Messages = () => {
 		const { objs, totalSize } = response.data
 		setMessages(objs)
 		setTotal(totalSize)
-		setLoading(false)
 	}
 
 	const handleReadMessage = async (id: number, status: MessageStatus) => {