diff --git a/client/api/Client.ts b/client/api/Client.ts index 17ad034..b88886c 100644 --- a/client/api/Client.ts +++ b/client/api/Client.ts @@ -41,7 +41,7 @@ class Client { if (re.code != 200) { if (re.code == -1) { auth() - } else if (re.code != 401) { + } else if (re.code != 401 && re.code != 400) { const s2 = checkApiSuccessOrSncakbar(re, "重新验证失败") s2!.autoCloseDelay = 0 s2!.action = "重试" @@ -98,7 +98,7 @@ class Client { // 错误处理 if (err) return resolve({ code: -1, - msg: err.message.indexOf("timed out") != -1 ? "請求超時" : err.message, + msg: err.message.indexOf("timed out") != -1 ? "请求超时" : err.message, }) // 在特殊的方法之中, 不予进行: 令牌刷新并重试 // 附带 retry 次数限制 diff --git a/client/ui/main/ContactsList.tsx b/client/ui/main/ContactsList.tsx index 1eb153f..52d8318 100644 --- a/client/ui/main/ContactsList.tsx +++ b/client/ui/main/ContactsList.tsx @@ -40,9 +40,9 @@ export default function ContactsList({ token: data.access_token, }) if (re.code != 200) { - if (re.code != 401) checkApiSuccessOrSncakbar(re, "获取收藏对话列表失败") - return - } + if (re.code != 401 && re.code != 400) checkApiSuccessOrSncakbar(re, "获取收藏对话列表失败") + return + } const ls = re.data!.contacts_list as Chat[] setContactsList(ls) setSharedFavouriteChats(ls) @@ -53,7 +53,7 @@ export default function ContactsList({ EventBus.off('ContactsList.updateContacts') } // 警告: 不添加 deps 導致無限執行 - }, []) + }, []) return