diff --git a/src/forge/SecuritySetting/notice/myNotice/Index.jsx b/src/forge/SecuritySetting/notice/myNotice/Index.jsx index 9f3d25bef..e2b9b6e3d 100644 --- a/src/forge/SecuritySetting/notice/myNotice/Index.jsx +++ b/src/forge/SecuritySetting/notice/myNotice/Index.jsx @@ -59,6 +59,9 @@ function MyNotice(props) { if(response.status === 200){ getMessageList(); resetUserInfo(); + //已读当前页码最后一条数据时跳转到前一页 + let totlaPage = Math.ceil((messTotalCount-1)/pageSize); + setCurrentPage(currentPage>=totlaPage? totlaPage : currentPage); } }); } @@ -117,10 +120,17 @@ function MyNotice(props) { axios.delete(`/users/${current_user.login}/messages.json`,{ data:params, }).then((response)=>{ - response.status === 200 && getMessageList(); + if(response.status === 200){ + getMessageList(); + //删除当前页码最后一条数据时跳转到前一页 + let totlaPage = Math.ceil((messTotalCount-1)/pageSize); + setCurrentPage(currentPage>=totlaPage? totlaPage : currentPage); + setSelectedNum(0); + } }); } }); + } function cancelBatchDelete(){ @@ -135,6 +145,7 @@ function MyNotice(props) { setBatchDeleteCheckAll(false); } + //跳转到消息详情页面 function turnToMess(item){ if(item.notification_url){ window.open(`${item.notification_url}`); @@ -147,7 +158,6 @@ function MyNotice(props) {