解决偶发报错

This commit is contained in:
al 2024-12-27 18:38:46 +08:00
parent bd7469f7fa
commit 3dc7204f8c
2 changed files with 4 additions and 1 deletions

View File

@ -23,7 +23,7 @@ export default function Reviewed({ currentIndex }) {
const account = get("account"); const account = get("account");
try { try {
const body = { const body = {
b_mid: account.mid, b_mid: account?.mid,
audit_type: 1, audit_type: 1,
offset: offset, offset: offset,
limit: 10, limit: 10,

View File

@ -53,6 +53,7 @@ const MessageList = ({ mid, changeNoticeCount, refInstance, noticeCount }) => {
]); ]);
useImperativeHandle(refInstance, () => ({ useImperativeHandle(refInstance, () => ({
readAllMsg: async (types) => { readAllMsg: async (types) => {
if (!data.session_id) return;
try { try {
const body = { const body = {
n_types: types, n_types: types,
@ -68,6 +69,7 @@ const MessageList = ({ mid, changeNoticeCount, refInstance, noticeCount }) => {
}); });
return; return;
} }
const _data2 = await requireAPI( const _data2 = await requireAPI(
"POST", "POST",
"/api/contact_customer_service/read_all", "/api/contact_customer_service/read_all",
@ -83,6 +85,7 @@ const MessageList = ({ mid, changeNoticeCount, refInstance, noticeCount }) => {
}); });
return; return;
} }
changeNoticeCount(0); changeNoticeCount(0);
} catch (error) { } catch (error) {
console.error(error); console.error(error);