Commit Graph

12 Commits

Author SHA1 Message Date
Chaos
50a3022e9d refactor(api): 重构API客户端以支持依赖注入
- 移除全局api实例,改用createApi工厂函数创建客户端
- 在服务层函数中添加api参数,实现依赖注入
- 更新设备、角色、用户等服务调用方式
- 移除请求头中的Authorization字段手动设置
- 在hooks.server.ts中初始化并挂载api到locals
- 修复HttpError类定义位置并完善错误处理逻辑
- 调整页面组件中main容器和表格布局样式
- 更新tailwindcss主题配置和相关CSS类名
- 修改分页大小默认值从10到12
- 删除冗余的COOKIE_TOKEN_KEY导入和重定向逻辑
2025-12-03 07:11:09 +08:00
Chaos
4cdf6bade8 feat(app): 实现用户管理页面功能
- 修复用户列表分页参数获取错误的问题
- 添加搜索和角色筛选功能
- 实现批量删除和封禁用户操作
- 优化页面布局和样式
- 添加调试日志输出
- 更新图标资源库
- 修复API客户端请求头传递问题
- 调整侧边栏导航样式和结构
- 减少模拟数据加载时间
- 添加COOKIE常量引用
2025-12-02 11:45:38 +08:00
Chaos
ab43a9a140 feat(users): 实现用户管理页面功能增强
- 添加用户列表分页、搜索和角色筛选功能
- 实现用户批量选择与操作(删除/封禁)
- 引入ofetch库优化API请求处理
- 添加表格加载状态和错误处理组件
- 更新图标组件属性以支持新特性
- 修复页面跳转状态码问题(302改为303)
- 优化用户表格UI展示细节与交互体验
2025-12-01 17:27:02 +08:00
Chaos
bd00e54acd refactor(api): improve http client implementation
- Removed redundant comments and code annotations
- Simplified type definitions and interface declarations
- Streamlined URL construction logic
- Enhanced body handling for FormData and JSON payloads
- Optimized header normalization process
- Cleaned up API method signatures
- Improved content-type handling for form data
- Removed unnecessary blank lines and formatting clutter
2025-12-01 09:24:26 +08:00
Chaos
c1138cd568 feat(api): enhance http client with formdata and sveltekit support
- Add support for FormData in request body handling
- Implement custom fetch option for SvelteKit integration
- Fix content-type header handling for multipart requests
- Improve error handling and logging
- Support absolute URLs in API requests
- Add proper typing for API result responses
- Handle HTTP 204 no-content responses correctly
- Update method signatures to accept FormData bodies
- Normalize headers case-insensitively
- Remove explicit body on GET/HEAD requests
2025-12-01 08:51:13 +08:00
Chaos
87892951f6 feat(device): 实现设备创建功能并优化API调用
- 添加设备创建接口,支持认证检查和重定向
- 更新设备服务以使用新的请求体类型
- 修改表单组件以支持设备创建请求和响应处理
- 扩展HTTP客户端和类型定义以支持对象类型的请求体
- 添加调试日志记录API响应信息
- 更新按钮点击事件处理函数以触发设备创建流程
2025-12-01 07:36:14 +08:00
Chaos
0a0e6df66b refactor(settings): 重构用户管理和设备管理页面
- 调整用户管理页面角色数据获取方法,使用 getRolesOptions 替代 getAllRoles
- 更新用户表格组件接收的角色数据属性名及类型
- 修改设备管理页面路由路径,从 /device/list 调整为 /devices
- 移除调试用 console.log 输出语句
- 添加选项类型 Options 接口定义
- 优化侧边栏导航结构与交互逻辑,支持父级菜单带链接可点击
- 引入日志模块用于 API 请求与响应记录
- 升级依赖包配置,移除 peer 标记
- 微调样式类名增强布局效果和用户体验
2025-11-29 09:02:00 +08:00
Chaos
2caa8f26a3 feat(device): add device management feature
- Created device list page with loading states
- Implemented device service with API integration
- Added device response and request types
- Updated sidebar navigation with device management section
- Added laptop-settings icon
- Modified user table component to accept props
- Updated user service to return array of user profiles
- Changed app language to Chinese (zh-CN)
2025-11-27 17:12:03 +08:00
Chaos
7d627a45fb feat(auth): 实现基于令牌的用户认证和访问控制
- 在用户相关页面服务端加载函数中添加令牌检查,防止未授权访问
- 更新用户服务方法以支持携带认证令牌请求API
- 修改用户资料和用户列表组件以适配新的认证流程
- 引入侧边栏状态管理并在布局中注册上下文
- 调整HTTP客户端逻辑以正确传递请求头信息
- 更新用户类型定义以匹配后端返回的角色结构
- 优化应用头部和侧边栏组件的UI细节和交互逻辑
2025-11-25 23:33:32 +08:00
Chaos
4ec8e88e58 refactor(auth): implement token-based authentication with JWT parsing
- Replace authStore with tokenService for authentication management
- Add JWT parsing utility to extract user info from tokens
- Update login flow to use cookie-based token storage
- Modify logout to properly clear auth state and cookies
- Integrate user data into page context for SSR compatibility
- Remove deprecated authStore and related localStorage logic
- Add cookie constants for consistent token handling
- Implement server-side token validation in hooks
- Update HTTP client to use token from cookies instead of store
- Refactor error handling to use unified ApiError class
- Replace manual redirect logic with resolved paths
- Improve type safety with explicit user and auth interfaces
- Add toast notifications for login/logout feedback
- Remove unused sidebar store and related UI logic
- Migrate theme handling to use cookies and context
- Update icon definitions and component references
- Clean up legacy code and unused imports
2025-11-25 16:53:48 +08:00
Chaos
ed542f108c feat(auth): implement login and user management features
- Added server-side login action with form handling and cookie storage
- Implemented user authentication service with token management
- Created user list page with data fetching from userService
- Developed reusable DataTable component with selection and pagination
- Enhanced AppSidebar with nested navigation and active state tracking
- Updated icon definitions and sprite symbols for UI consistency
- Improved HTTP client to properly handle request bodies for different methods
- Refactored auth store to manage authentication state and cookies
- Added strict typing for navigation items and table columns
- Removed obsolete code and simplified authentication flow
2025-11-24 17:11:41 +08:00
Chaos
cdd14b3c85 feat(应用): 实现带可折叠侧边栏的仪表盘布局
添加从根路径到/app/dashboard的服务器端重定向
创建包含主内容容器的应用布局组件
实现带响应式侧边栏和顶栏的仪表盘页面
添加带平滑过渡效果的侧边栏切换功能
设置基础用户状态管理仓库
使用对等依赖标志更新package-lock.json中的依赖项
从锁定文件中移除冗余的picomatch条目
添加带路径解析导入的登录页面组件
2025-11-21 17:29:11 +08:00