fix: redirect to home page after login success
This commit is contained in:
@@ -28,6 +28,7 @@ export default function LoginPage({ onLogin }: Props) {
|
||||
if (res.ok && data.access_token) {
|
||||
localStorage.setItem('token', data.access_token)
|
||||
onLogin(data.access_token)
|
||||
window.location.href = '/'
|
||||
} else {
|
||||
setError(data.error || '登录失败')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user