fix(user): simplify error handling by skipping notification for empty token

This commit is contained in:
Sheldon Guo 2025-02-20 09:21:45 +08:00
parent 0a54efc7d9
commit 1ce5ea0fe1

View File

@ -44,13 +44,7 @@ export const CurrentUserProvider = (props) => {
api
.request({
url: '/auth:check',
skipNotify: (error) => {
const errs = api.toErrMessages(error);
if (errs.find((error: { code?: string }) => error.code === 'EMPTY_TOKEN')) {
return true;
}
return false;
},
skipNotify: true,
skipAuth: true,
})
.then((res) => res?.data),