mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-07 10:12:27 +08:00
refactor(frontend): 优化工具和 API 模块
- 改进 sanitize 工具函数 - 优化 mocks 数据和处理器 - 优化 auth API 模块
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user