feat: add logout

This commit is contained in:
LittleBoy 2024-08-02 21:50:27 +08:00
parent d1382d762c
commit 770f320372

View File

@ -110,6 +110,12 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
}
// 登出
const logout = async () => {
setTimeout(()=>{
const a = document.createElement('a')
a.setAttribute('href','https://portal.chuhai.edu.hk/signout')
a.setAttribute('target','_blank')
a.click()
},0)
setAuthToken(null)
removeRoleStorage()
dispatch({