|
@@ -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) => {
|