fix(mp): 五专家组审查 HIGH 级问题修复 — 9 项

- S-1: 隐私政策描述修正("混淆加密" → "HTTPS + 微信沙箱")
- A-1: getCachedPatientId 统一导出 + 9 处 Storage 直读替换
- A-2: usePageData loading 改为 useState 响应式
- A-3: health.ts refreshingToday 移入 store state
- M-2: prod config 移除 console.error/warn
- M-4: clearCache 后同步刷新 request.ts 内存缓存
- Q-3: doctor/appointment.ts any[] → Appointment 类型
- Q-4: daily-monitoring 常量提取到 constants.ts
- 清理: 删除空目录 FamilyPicker/HealthCard + 未使用组件 DeviceCard
This commit is contained in:
iven
2026-05-15 09:17:36 +08:00
parent 9bd2d4c2e6
commit dc983945ff
19 changed files with 93 additions and 166 deletions

View File

@@ -1,4 +1,5 @@
import { api } from '../request';
import type { Appointment } from '../appointment';
// ── Appointments (doctor view) ─────────────────────
@@ -7,6 +8,7 @@ export async function listAppointments(params?: {
page_size?: number;
status?: string;
date?: string;
patient_id?: string;
}) {
return api.get<{ data: any[]; total: number }>('/health/appointments', params);
return api.get<{ data: Appointment[]; total: number }>('/health/appointments', params);
}

View File

@@ -1,5 +1,4 @@
import Taro from '@tarojs/taro';
import { api } from './request';
import { api, getCachedPatientId } from './request';
export interface MedicationReminder {
id: string;
@@ -42,7 +41,7 @@ export interface UpdateReminderReq {
}
function getPatientId(): string {
return Taro.getStorageSync('current_patient_id') || '';
return getCachedPatientId();
}
export async function listReminders() {

View File

@@ -307,6 +307,10 @@ export function setCachedPatientId(id: string): void {
responseCache.setPatientId(id);
}
export function getCachedPatientId(): string {
return responseCache.getPatientId();
}
export function clearRequestCache(prefix?: string): void {
responseCache.clear(prefix);
}