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,5 +1,6 @@
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { safeNavigateTo } from '@/utils/navigate';
|
||||
import { useState, useCallback } from 'react';
|
||||
import { useAuthStore } from '../../stores/auth';
|
||||
import { usePointsStore } from '../../stores/points';
|
||||
@@ -113,7 +114,7 @@ export default function Profile() {
|
||||
if (item.isSwitchTab) {
|
||||
Taro.switchTab({ url: item.path });
|
||||
} else {
|
||||
Taro.navigateTo({ url: item.path });
|
||||
safeNavigateTo(item.path);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -188,7 +189,7 @@ export default function Profile() {
|
||||
<ContentCard
|
||||
padding="none"
|
||||
margin="none"
|
||||
onPress={() => Taro.navigateTo({ url: '/pages/pkg-profile/notifications/index' })}
|
||||
onPress={() => safeNavigateTo('/pages/pkg-profile/notifications/index')}
|
||||
>
|
||||
<View className='menu-item'>
|
||||
<View className='menu-icon menu-icon--pri-l'>
|
||||
|
||||
Reference in New Issue
Block a user