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:
iven
2026-05-21 22:34:14 +08:00
parent ee7dd0d6e1
commit fd994edf3e
3 changed files with 13 additions and 21 deletions

View File

@@ -21,11 +21,7 @@ const ERROR_CODE_MAP: Record<string, string> = {
};
function safeGet(key: string): string {
try {
return secureGet(key);
} catch {
return Taro.getStorageSync(key) || '';
}
return secureGet(key);
}
// --- Concurrency limiter ---