fix(auth+miniprogram): 清除全部审计遗留问题
MEDIUM: - WechatLoginReq/WechatBindPhoneReq 添加 Validate 派生 + 字段校验规则 - handler 中调用 req.validate() 并 map_err 转换 - 新增 AuthError::DbError 变体,wechat_service 所有 DB 错误从 Validation 改为 DbError - DbError 映射到 AppError::Internal,不再误导前端 LOW: - fetch_session 改用 reqwest Client.query() 构建参数,自动 URL 编码 - app.tsx PropsWithChildren<any> 改为 Record<string, unknown> - login handleGetPhone 回调 e: any 改为内联类型 - appointment/create 4 个事件回调 e: any 改为内联类型 - health/input catch (e: any) 改为 catch (e: unknown) + instanceof 守卫 - report/detail Object.entries 去掉 [string, any] 类型断言 - wechat_service 移除 decrypt_phone_placeholder 函数,内联占位注释
This commit is contained in:
@@ -29,7 +29,7 @@ export default function AppointmentCreate() {
|
||||
const currentPatient = useAuthStore((s) => s.currentPatient);
|
||||
|
||||
// Step 1: 选择科室后加载医生列表
|
||||
const onDepartmentChange = useCallback(async (e: any) => {
|
||||
const onDepartmentChange = useCallback(async (e: { detail: { value: number } }) => {
|
||||
const idx = e.detail.value;
|
||||
const dept = DEPARTMENTS[idx];
|
||||
setDeptPickerIndex(idx);
|
||||
@@ -50,17 +50,17 @@ export default function AppointmentCreate() {
|
||||
}, []);
|
||||
|
||||
// Step 3: 日期变更
|
||||
const onDateChange = useCallback((e: any) => {
|
||||
const onDateChange = useCallback((e: { detail: { value: string } }) => {
|
||||
setAppointmentDate(e.detail.value);
|
||||
}, []);
|
||||
|
||||
// Step 3: 时段变更
|
||||
const onTimeSlotChange = useCallback((e: any) => {
|
||||
const onTimeSlotChange = useCallback((e: { detail: { value: string } }) => {
|
||||
setTimeSlot(e.detail.value);
|
||||
}, []);
|
||||
|
||||
// Step 3: 备注变更
|
||||
const onReasonChange = useCallback((e: any) => {
|
||||
const onReasonChange = useCallback((e: { detail: { value: string } }) => {
|
||||
setReason(e.detail.value);
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -59,8 +59,9 @@ export default function HealthInput() {
|
||||
}
|
||||
Taro.showToast({ title: '录入成功', icon: 'success' });
|
||||
setTimeout(() => Taro.navigateBack(), 1000);
|
||||
} catch (e: any) {
|
||||
Taro.showToast({ title: e.message || '录入失败', icon: 'none' });
|
||||
} catch (e: unknown) {
|
||||
const msg = e instanceof Error ? e.message : '录入失败';
|
||||
Taro.showToast({ title: msg, icon: 'none' });
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function Login() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleGetPhone = async (e: any) => {
|
||||
const handleGetPhone = async (e: { detail: { errMsg: string; encryptedData: string; iv: string } }) => {
|
||||
if (e.detail.errMsg !== 'getPhoneNumber:ok') {
|
||||
Taro.showToast({ title: '需要授权手机号', icon: 'none' });
|
||||
return;
|
||||
|
||||
@@ -32,7 +32,7 @@ export default function ReportDetail() {
|
||||
|
||||
const indicators: IndicatorItem[] = React.useMemo(() => {
|
||||
if (!report?.indicators || typeof report.indicators !== 'object') return [];
|
||||
return Object.entries(report.indicators).map(([name, val]: [string, any]) => ({
|
||||
return Object.entries(report.indicators).map(([name, val]) => ({
|
||||
name,
|
||||
value: val.value,
|
||||
unit: val.unit,
|
||||
|
||||
Reference in New Issue
Block a user