修复会话安全与实时消息
This commit is contained in:
@@ -13,9 +13,9 @@ const Login = () => {
|
||||
const onFinish = async (values: { username: string; password: string }) => {
|
||||
setLoading(true)
|
||||
try {
|
||||
await login(values.username, values.password)
|
||||
const user = await login(values.username, values.password)
|
||||
message.success('登录成功')
|
||||
navigate('/agent/dashboard', { replace: true })
|
||||
navigate(user.role === 'platform_admin' ? '/admin/dashboard' : '/agent/dashboard', { replace: true })
|
||||
} catch {
|
||||
message.error('用户名或密码错误')
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user