fix(miniprogram): 审计修复 — P0/P1 共 16 个问题
P0 功能阻断: - 修复 login→bindPhone openid 状态传递断裂 - 首页健康卡片对接 useHealthStore 真实数据 - 血压录入改为收缩压/舒张压双输入 - 快捷服务路径修正(报告→/pages/report、随访→/pages/followup) P1 类型安全 + 组件: - 替换所有 <input>/<image>/<textarea> 为 Taro 组件 - service 层 any 类型全部替换(Doctor/DoctorSchedule/IndicatorDetail/FollowUpContent/PatientUpdateInput) - 预约详情数据传递简化为纯 Storage 缓存 - Article 接口添加 author 字段
This commit is contained in:
@@ -6,7 +6,6 @@ import './index.scss';
|
||||
|
||||
export default function Login() {
|
||||
const [needBind, setNeedBind] = useState(false);
|
||||
const [openid, setOpenid] = useState('');
|
||||
const { login, bindPhone, loading } = useAuthStore();
|
||||
|
||||
const handleWechatLogin = async () => {
|
||||
@@ -16,11 +15,10 @@ export default function Login() {
|
||||
if (success) {
|
||||
Taro.switchTab({ url: '/pages/index/index' });
|
||||
} else {
|
||||
// 未绑定,需要获取手机号
|
||||
// 未绑定,需要获取手机号(openid 已由 store 缓存到 Storage)
|
||||
setNeedBind(true);
|
||||
// 从最近的登录响应获取 openid(简化处理)
|
||||
}
|
||||
} catch (e: any) {
|
||||
} catch {
|
||||
Taro.showToast({ title: '登录失败', icon: 'none' });
|
||||
}
|
||||
};
|
||||
@@ -31,7 +29,7 @@ export default function Login() {
|
||||
return;
|
||||
}
|
||||
const { encryptedData, iv } = e.detail;
|
||||
const success = await bindPhone(openid, encryptedData, iv);
|
||||
const success = await bindPhone(encryptedData, iv);
|
||||
if (success) {
|
||||
Taro.switchTab({ url: '/pages/index/index' });
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user