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 api
.request({ .request({
url: '/auth:check', url: '/auth:check',
skipNotify: (error) => { skipNotify: true,
const errs = api.toErrMessages(error);
if (errs.find((error: { code?: string }) => error.code === 'EMPTY_TOKEN')) {
return true;
}
return false;
},
skipAuth: true, skipAuth: true,
}) })
.then((res) => res?.data), .then((res) => res?.data),