Files
AIclinicalresearch/backend/测试用户说明.md
HaHafeng 88cc049fb3 feat(asl): Complete Day 5 - Fulltext Screening Backend API Development
- Implement 5 core API endpoints (create task, get progress, get results, update decision, export Excel)
- Add FulltextScreeningController with Zod validation (652 lines)
- Implement ExcelExporter service with 4-sheet report generation (352 lines)
- Register routes under /api/v1/asl/fulltext-screening
- Create 31 REST Client test cases
- Add automated integration test script
- Fix PDF extraction fallback mechanism in LLM12FieldsService
- Update API design documentation to v3.0
- Update development plan to v1.2
- Create Day 5 development record
- Clean up temporary test files
2025-11-23 10:52:07 +08:00

109 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 测试用户初始化说明
## 问题
创建知识库时报错 "User not found",因为数据库中没有用户记录。
## 解决方案
### 方法1运行批处理脚本推荐
双击运行:**`初始化测试用户.bat`**
这个脚本会自动创建两个测试用户:
- 普通用户user-mock-001
- 管理员用户user-admin-001
### 方法2手动运行命令
```bash
cd backend
npm run prisma:seed
```
## 测试账号信息
### 普通用户
- **用户ID**: `user-mock-001`
- **邮箱**: `test@example.com`
- **密码**: `password123`
- **知识库配额**: 3个
- **试用期**: 30天
### 管理员用户
- **用户ID**: `user-admin-001`
- **邮箱**: `admin@example.com`
- **密码**: `password123`
- **知识库配额**: 10个
## 说明
1. **当前系统使用硬编码的用户ID**
- 后端控制器使用 `MOCK_USER_ID = 'user-mock-001'`
- 所有API请求都使用这个固定ID
2. **用户认证系统未实现**
- 当前处于开发阶段
- 用户登录/注册功能在里程碑3实现
3. **重新初始化数据库后需要重新运行seed**
- 如果执行了 `prisma migrate reset`
- 或手动清空了数据库
- 需要重新运行 `初始化测试用户.bat`
## 验证
运行seed脚本后可以通过Prisma Studio验证
```bash
npm run prisma:studio
```
在浏览器中打开,查看 `users` 表,应该能看到两个用户记录。
## 下一步
初始化完成后,就可以正常创建知识库了!🎉