npm run dev
等待服务器启动完成(通常需要 10-30 秒)
http://localhost:4200/wxwork/test/activation
说明:
test 是特殊的测试公司IDhttp://localhost:4200/wxwork/test/designer/dashboard
说明:
访问激活页面
http://localhost:4200/wxwork/test/activation
检查显示内容
点击"确认身份"
检查激活后界面
在激活页面点击"开始填写问卷"
跳转到问卷页面
URL: /wxwork/test/survey/profile
填写问卷
提交问卷
返回激活页面
手动访问:
http://localhost:4200/wxwork/test/activation
在激活页面点击"已完成?刷新状态"
检查状态更新
点击"查看问卷结果"
检查结果页面
返回激活页面
点击"进入工作台"
根据角色跳转
/wxwork/test/designer/dashboard/wxwork/test/team-leader/dashboard检查访问权限
清除浏览器缓存
按 Ctrl + Shift + Delete
选择"Cookie 和其他网站数据"
点击"清除数据"
再次访问激活页面
http://localhost:4200/wxwork/test/activation
检查行为
打开浏览器开发者工具(F12),查看 Console 标签:
期望看到的日志:
🔐 初始化企微认证...
✅ 用户信息获取成功: 测试员工
📋 激活状态: false
⚡ 开始激活...
✅ 激活成功!
// 在浏览器控制台执行
const Parse = FmodeParse.with('nova');
const query = new Parse.Query('Profile');
query.equalTo('userid', 'test_user_001'); // 替换为实际 userid
const profile = await query.first();
if (profile) {
profile.set('isActivated', false);
profile.set('surveyCompleted', false);
await profile.save();
console.log('✅ 已重置激活状态');
location.reload();
}
const Parse = FmodeParse.with('nova');
const query = new Parse.Query('Profile');
query.equalTo('userid', 'test_user_001');
const profile = await query.first();
if (profile) {
profile.set('surveyCompleted', true);
profile.set('surveyCompletedAt', new Date());
await profile.save();
console.log('✅ 已标记问卷完成');
location.reload();
}
在开发者工具 → Network 标签:
期望看到的请求:
1. GET /classes/Profile?where={"userid":"test_user_001"}
2. PUT /classes/Profile/{objectId} (激活时)
3. GET /classes/SurveyLog?where={"type":"survey-profile"} (查看结果时)
{
id: 'mock_profile_001',
userid: 'test_user_001',
name: '测试员工',
realname: '张设计师',
roleName: '组员',
avatar: '/assets/images/default-avatar.svg',
isActivated: false, // 初始未激活
surveyCompleted: false // 初始未完成问卷
}
{
userid: 'test_user_001',
name: '测试员工',
mobile: '13800138000',
department: [1, 2],
avatar: '/assets/images/default-avatar.svg'
}
检查:
// 1. 检查 localStorage 中的 company
console.log(localStorage.getItem('company'));
// 2. 检查路由参数
console.log(window.location.href);
// 3. 检查网络请求
// 打开 Network 标签,看是否有失败的请求
检查:
// 1. 查看控制台是否有错误
// 2. 检查 WxworkAuth 初始化是否成功
// 3. 检查 Parse 连接是否正常
// 手动测试 Parse 连接
const Parse = FmodeParse.with('nova');
const TestObject = Parse.Object.extend('_User');
const query = new Parse.Query(TestObject);
query.limit(1);
const result = await query.find();
console.log('Parse 连接正常:', result);
检查:
// 1. 确认 Profile 的 surveyCompleted 字段
const Parse = FmodeParse.with('nova');
const query = new Parse.Query('Profile');
query.equalTo('userid', 'test_user_001');
const profile = await query.first();
console.log('surveyCompleted:', profile?.get('surveyCompleted'));
// 2. 确认 SurveyLog 是否存在
const surveyQuery = new Parse.Query('SurveyLog');
surveyQuery.equalTo('type', 'survey-profile');
surveyQuery.equalTo('profile', profile.toPointer());
const surveyLog = await surveyQuery.first();
console.log('SurveyLog:', surveyLog);
## 测试结果
**测试日期**: 2025-01-01
**测试人员**: XXX
**测试环境**: 本地开发环境
### 场景1: 首次激活
- [ ] 通过
- [ ] 失败
- 问题描述: ___________
### 场景2: 填写问卷
- [ ] 通过
- [ ] 失败
- 问题描述: ___________
### 场景3: 刷新状态
- [ ] 通过
- [ ] 失败
- 问题描述: ___________
### 场景4: 查看结果
- [ ] 通过
- [ ] 失败
- 问题描述: ___________
### 场景5: 进入工作台
- [ ] 通过
- [ ] 失败
- 问题描述: ___________
### 场景6: 已激活用户
- [ ] 通过
- [ ] 失败
- 问题描述: ___________
### 总体评价
___________
### 建议改进
___________
测试完成后:
部署到测试环境
npm run build
# 部署到测试服务器
真实企微环境测试
性能优化
生产发布