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:
@@ -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 ---
|
||||
|
||||
Reference in New Issue
Block a user