refactor(frontend): 优化工具和 API 模块

- 改进 sanitize 工具函数
- 优化 mocks 数据和处理器
- 优化 auth API 模块
This commit is contained in:
fawney19
2025-12-12 20:22:22 +08:00
parent fda0bfa8de
commit 380fd1c4d4
4 changed files with 6 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
import apiClient from './client'
import { log } from '@/utils/logger'
export interface LoginRequest {
email: string
@@ -65,7 +66,7 @@ export const authApi = {
await apiClient.post('/api/auth/logout', {})
} catch (error) {
// 即使后端登出失败,也要清除本地认证信息
console.warn('后端登出失败,仅清除本地认证信息:', error)
log.warn('后端登出失败,仅清除本地认证信息:', error)
} finally {
// 清除本地认证信息
apiClient.clearAuth()