fix(mp): 存储层语义统一 + UTF-16 截断修复
- secureGet: 增加 TextEncoder/TextDecoder 替代 charCodeAt 避免 UTF-16 截断 - secureGet: _es_ 前缀键返回空时增加明文键 fallback(对齐 storageGet 语义) - request.ts safeGet / auth.ts storageGet: 简化为直接委托 secureGet
This commit is contained in:
@@ -4,11 +4,9 @@ import * as authApi from '@/services/auth';
|
||||
import { secureGet, secureSet, secureRemove } from '@/utils/secure-storage';
|
||||
import { clearRequestCache, markLoggingOut, clearLoggingOut, setCachedPatientId } from '@/services/request';
|
||||
|
||||
// secureGet fallback: _es_ 加密键为空时尝试明文键(兼容 MCP 注入等场景)
|
||||
// secureGet 已内置明文键 fallback,无需再手动 fallback
|
||||
function storageGet(key: string): string {
|
||||
const val = secureGet(key);
|
||||
if (val) return val;
|
||||
return Taro.getStorageSync(key) || '';
|
||||
return secureGet(key);
|
||||
}
|
||||
import { resetAllStores } from './index';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user