refactor: 优化认证系统和组件类型安全性

- 新增 safeLocalStorage 工具函数增强本地存储安全性
- 简化认证流程,重构用户数据结构和 token 管理
- 修复多个模块的 TypeScript 类型错误和导入问题
- 优化状态管理,重构各模块 store 结构
- 清理冗余代码,移除未使用的组件和函数
- 改进错误处理和边界情况处理
- 更新配置文件以支持最新的类型检查

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-13 14:52:52 +08:00
parent dfc29ce01f
commit 68d9d97142
29 changed files with 1122 additions and 3001 deletions

View File

@@ -38,6 +38,7 @@ export interface LoginLogsQueryParams {
ip_address?: string;
sort_order?: 'asc' | 'desc';
order_by?: string;
keyword?:string;
}
// 分页状态接口
@@ -83,13 +84,11 @@ export const fetchLoginLogs = async (params: LoginLogsQueryParams = {}) => {
query: {
page: params.page || 1,
size: params.size || 10,
username: params.username,
keyword: params.keyword,
status: params.status,
start_time: params.start_time,
end_time: params.end_time,
ip_address: params.ip_address,
sort_order: params.sort_order || 'desc',
order_by: params.order_by || 'created_at',
}
});

View File

@@ -19,7 +19,6 @@ import {
LoginLog,
PaginationState,
LoginLogsQueryParams,
fetchLoginStatistics,
exportLoginLogs
} from './components/loginLogApi';
@@ -39,7 +38,6 @@ export default function LoginLogPage() {
search: '',
status: 'all'
});
const isFirstLoad = useRef(true);
// 搜索字段配置
const searchFields: SearchFieldConfig[] = [