npm run dev # 这个命令不存在!
npm start # 这才是正确的命令
4300(不是 4200)http://localhost:4300/test-data-cleanup
http://localhost:4300/wxwork/test/activation
⚠️ 重要:不要直接访问问卷页面,必须从激活页面点击按钮进入!
cd C:\Users\刚sir\yss-project
npm start
等待编译完成后,会提示:
Application bundle generation complete.
Initial chunk files | Names | Raw size
...
访问:
http://localhost:4300/test-data-cleanup
点击 "🗑️ 清理测试用户问卷数据" 按钮,等待"清理完成"提示。
访问激活页面:
http://localhost:4300/wxwork/test/activation
原因: 端口错误
解决: 使用 4300 端口,不是 4200
原因: 读取了旧的真实问卷数据
解决:
http://localhost:4300/test-data-cleanup原因: Profile.surveyCompleted 字段未正确更新
解决: 已修复,问卷提交时会同时更新 SurveyLog 和 Profile
原因: 测试模式下不应该初始化 WxworkAuth
解决: 已修复,测试模式下跳过企微认证,直接使用测试Profile
✅ 清理工具成功删除旧数据
✅ 激活页面显示"待完成"状态
✅ 可以正常填写问卷(21道题)
✅ 提交后返回激活页
✅ 刷新后显示"已完成"和问卷结果
✅ 控制台显示:🔍 查询 userid: test_user_001
✅ 控制台显示:📝 最新问卷状态: true
test_user_001问卷组件在测试模式(cid === 'test')下,不再读取localStorage中的Profile ID,而是直接查询或创建 userid = test_user_001 的测试Profile。
激活组件和问卷组件在测试模式下都使用固定的 test_user_001 作为userid,确保数据一致。
替换 profile.fetch() 为 Parse.Query,确保在测试环境下也能正确获取最新的问卷状态。
问卷提交时,同时更新 Profile 表的 surveyCompleted 字段和 SurveyLog 表的记录,保证数据一致性。