imeepos
|
ca63868282
|
fix: bug
|
2026-01-28 14:39:46 +08:00 |
imeepos
|
bf11241d68
|
feat: 实现用户名和头像编辑功能
使用 Better Auth 的 updateUser API 更新用户信息,使用 SDK 的 FileController 上传头像。
## 新增功能
- 创建 useUpdateProfile hook 处理用户信息更新
- 支持选择图片上传头像(使用 expo-image-picker)
- 先上传头像到 S3,再更新用户信息
## 更新文件
- lib/auth.ts: 导出 updateUser 方法
- hooks/use-update-profile.ts: 新建更新资料 hook
- hooks/index.ts: 导出 useUpdateProfile
- components/drawer/EditProfileDrawer.tsx:
- 添加头像选择功能(点击相机按钮)
- 调用 updateProfile API 保存更改
- 添加加载状态和禁用状态
- 更新 onSave 回调参数类型
- app/(tabs)/my.tsx:
- 传递 initialAvatar 给编辑抽屉
- 显示用户真实头像(如有)
- 更新 onSave 回调处理
## 功能流程
1. 点击相机按钮选择图片
2. 调用 uploadFile 上传到 S3
3. 调用 updateUser 更新用户信息
4. 保存成功后刷新 session
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-01-23 19:42:13 +08:00 |
imeepos
|
e1340fa101
|
feat: 实现 API 接口对接功能 (删除作品、作品搜索、修改密码)
按照 TDD 规范完成三个核心功能的接口对接:
## 新增功能
### 1. 删除作品功能 (app/generationRecord.tsx)
- 新增 use-template-generation-actions.ts hook
- 支持单个删除和批量删除作品
- 删除确认对话框
- 删除成功后自动刷新列表
- 完整的错误处理和加载状态
### 2. 作品搜索功能 (app/searchWorksResults.tsx)
- 新增 use-works-search.ts hook
- 替换模拟数据为真实 SDK 接口
- 支持关键词搜索和分类筛选
- 支持分页加载
- 完整的加载、错误、空结果状态处理
### 3. 修改密码功能 (app/changePassword.tsx)
- 新增 use-change-password.ts hook
- 使用 Better Auth 的 changePassword API
- 客户端表单验证(密码长度、确认密码匹配等)
- 成功后自动返回并提示
## 技术实现
- 严格遵循 TDD 规范(先写测试,后写实现)
- 新增 3 个 hooks 和对应的单元测试
- 更新中英文翻译文件
- 更新 jest.setup.js 添加必要的 mock
## 文档
- 新增 api_integration_report.md - API 对接分析报告
- 新增 api_integration_development_plan.md - 开发计划和完成汇总
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-01-23 19:15:24 +08:00 |
imeepos
|
fb719c6ea2
|
fix: 对接退出登录
|
2026-01-13 17:03:14 +08:00 |
imeepos
|
37a4a2f807
|
fix: 成功对接登录接口
|
2026-01-13 16:25:49 +08:00 |
imeepos
|
c2c097efb3
|
fix: 添加 Content-Type: application/json 请求头
修复登录/注册接口返回 VALIDATION_ERROR 的问题
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-01-13 16:01:13 +08:00 |
imeepos
|
24fd3a8847
|
feat: 完善认证系统
- 修复 Storage 层使用 AsyncStorage
- 统一 Token 存储键名为 bestaibest.better-auth.session_token
- 启用 401 自动跳转登录页并显示 Toast 提示
- 添加全局认证守卫(AuthGuard 组件)
- 修复 x-ownerid header 配置(从环境变量读取商户ID)
- 导出 loomart API 供活动数据使用
主要修改:
- lib/storage.native.ts: 新建,使用 AsyncStorage
- lib/storage.ts: 添加错误处理和注释
- lib/fetch-logger.ts: 统一 Token 键,启用 401 拦截
- lib/auth.ts: 导出 TOKEN_KEY,修复 x-ownerid,导出 loomart
- app/_layout.tsx: 添加 AuthGuard 组件实现路由守卫
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-01-13 16:00:02 +08:00 |
imeepos
|
1a6df3c806
|
fix: 登录页面
|
2026-01-13 15:55:52 +08:00 |
imeepos
|
9fa65a9ac3
|
fix: 添加better auth 接口配置
|
2026-01-13 14:58:48 +08:00 |
imeepos
|
02d0c807cd
|
Initial commit: expo-popcore-app
|
2025-12-25 16:25:55 +08:00 |