优化小程序登录流程,增加用户协议和隐私政策的勾选机制,确保用户主动同意后方可登录,符合审核要求。同时,增强错误处理逻辑,提升用户体验和系统稳定性。新增用户协议和隐私政策页面,更新相关样式以改善界面交互。
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
BookOpen,
|
||||
} from 'lucide-react'
|
||||
import { get, post } from '@/api/client'
|
||||
import { clearAdminToken } from '@/api/auth'
|
||||
|
||||
const menuItems = [
|
||||
{ icon: LayoutDashboard, label: '数据概览', href: '/dashboard' },
|
||||
@@ -52,7 +53,12 @@ export function AdminLayout() {
|
||||
}, [mounted, navigate])
|
||||
|
||||
const handleLogout = async () => {
|
||||
await post('/api/admin/logout', {})
|
||||
clearAdminToken()
|
||||
try {
|
||||
await post('/api/admin/logout', {})
|
||||
} catch {
|
||||
// 忽略登出接口失败,本地已清 token
|
||||
}
|
||||
navigate('/login', { replace: true })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user