fix(mp): P1+P2 稳定性加固 — 导航安全+生产日志+分包预加载+logout清理
P1: - 全局 23 个页面 Taro.navigateTo → safeNavigateTo,防止页栈超10层 - 生产构建保留 console.warn/error,便于线上问题排查 - 添加 preloadRule 分包预加载(首页预加载健康/医生/文章分包) P2: - logout 时清理 ai_chat_history + BLE DataBuffer 缓存 - restore() 移除冗余的双重 Storage 读取(secureGet 已包含 getStorageSync) - 首页文章图片添加 lazyLoad
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useState, useCallback } from 'react';
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import Taro, { useRouter } from '@tarojs/taro';
|
||||
import { safeNavigateTo } from '@/utils/navigate';
|
||||
import { usePageData } from '@/hooks/usePageData';
|
||||
import {
|
||||
getDialysisRecord, reviewDialysisRecord,
|
||||
@@ -167,9 +168,7 @@ export default function DialysisDetail() {
|
||||
</View>
|
||||
)}
|
||||
{record.status === 'draft' && (
|
||||
<View className='action-btn action-btn--secondary' onClick={() => Taro.navigateTo({
|
||||
url: `/pages/pkg-doctor-clinical/dialysis/create/index?id=${id}&version=${record.version}`,
|
||||
})}>
|
||||
<View className='action-btn action-btn--secondary' onClick={() => safeNavigateTo(`/pages/pkg-doctor-clinical/dialysis/create/index?id=${id}&version=${record.version}`)}>
|
||||
<Text className='action-btn__text'>编辑</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import Taro, { useRouter } from '@tarojs/taro';
|
||||
import { safeNavigateTo } from '@/utils/navigate';
|
||||
import { usePageData } from '@/hooks/usePageData';
|
||||
import { listLabReports, type LabReportItem } from '@/services/doctor/labReport';
|
||||
import { listPatients } from '@/services/doctor/patient';
|
||||
@@ -99,9 +100,7 @@ export default function ReportList() {
|
||||
{reports.map((r) => (
|
||||
<ContentCard
|
||||
key={r.id}
|
||||
onPress={() => Taro.navigateTo({
|
||||
url: `/pages/pkg-doctor-clinical/report/detail/index?patientId=${currentPatientId}&id=${r.id}`,
|
||||
})}
|
||||
onPress={() => safeNavigateTo(`/pages/pkg-doctor-clinical/report/detail/index?patientId=${currentPatientId}&id=${r.id}`)}
|
||||
>
|
||||
<View className="report-card__header">
|
||||
<Text className="report-card__type">{r.report_type}</Text>
|
||||
|
||||
Reference in New Issue
Block a user