diff --git a/src/provider/AppProvider.tsx b/src/provider/AppProvider.tsx index 95010a6..206ad45 100644 --- a/src/provider/AppProvider.tsx +++ b/src/provider/AppProvider.tsx @@ -29,7 +29,9 @@ const AppProvider: React.FC = ({ children }) => { const res: APIResponse = await BambooService.getUserInfo(); if (res?.error) return null; message.success(`Welcome back, ${res?.data?.name}`); - return res?.data; + + const role = res?.data?.role ?? 'user'; + return { ...res?.data, role: role.toLowerCase() as IUser['role'] }; }, { staleTime: Infinity,