- 新增配置、存储、金额转换工具服务 - 按userId隔离本地缓存,替换旧设备级存储 - 统一移动端金额单位为万元,新增转换适配逻辑 - 重构认证与请求逻辑,支持真实后端会话 - 调整搜索、帮助、融资模块的模拟开关与数据适配 - 更新文档说明开发状态与配置规则
12 lines
686 B
Plaintext
12 lines
686 B
Plaintext
import { getSession } from './api.uts'
|
|
|
|
// 旧的设备级缓存不自动归给新登录用户;按稳定userId隔离,匿名使用独立空间。
|
|
export function userStorageKey(key: string): string {
|
|
const session = getSession()
|
|
const owner = session == null ? 'guest' : 'user:' + (session['userId'] as string)
|
|
return 'airz:v1:' + owner + ':' + key
|
|
}
|
|
export function getUserStorage(key: string): any | null { return uni.getStorageSync(userStorageKey(key)) }
|
|
export function setUserStorage(key: string, value: any): void { uni.setStorageSync(userStorageKey(key), value) }
|
|
export function removeUserStorage(key: string): void { uni.removeStorageSync(userStorageKey(key)) }
|