fix(miniprogram+auth): 二次审计修复 — 3 HIGH + 2 MEDIUM
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

HIGH:
- wechat_users 迁移补充 created_by/updated_by/version 标准字段
- Entity 同步更新,bind_phone 创建记录时填充新字段
- appointment create 移除 schedule_id 空字符串,改为可选
- appointment list 用 useRef 替代 useCallback 的 loading 依赖,消除 stale closure

MEDIUM:
- report 页 patientId 从顶层读取改为 useDidShow 内动态获取,就诊人切换后正确刷新
- profile/reports 同上修复
- profile/followups 移除 useDidShow 非法的第二参数
This commit is contained in:
iven
2026-04-24 08:05:58 +08:00
parent 4867202437
commit ef6d76ef6c
9 changed files with 25 additions and 16 deletions

View File

@@ -14,9 +14,8 @@ export default function ReportList() {
const [total, setTotal] = useState(0);
const [loading, setLoading] = useState(false);
const patientId = Taro.getStorageSync('current_patient_id') || '';
const fetchData = useCallback(async (p: number, append = false) => {
const patientId = Taro.getStorageSync('current_patient_id') || '';
if (!patientId) return;
setLoading(true);
try {
@@ -30,7 +29,7 @@ export default function ReportList() {
} finally {
setLoading(false);
}
}, [patientId]);
}, []);
useDidShow(() => {
fetchData(1);