fix: jump to the home page after switching roles

This commit is contained in:
chenos 2022-04-13 12:30:07 +08:00
parent b1decb359b
commit ad2135b4cb

View File

@ -46,7 +46,7 @@ export const SwitchRole = () => {
onChange={async (roleName) => {
setRoleName(roleName);
await api.resource('users').setDefaultRole({ values: { roleName } });
window.location.reload();
window.location.href = '/';
}}
/>
</Menu.Item>