IOS小组件/文案
This commit is contained in:
16
client/src/utils/bootSession.ts
Normal file
16
client/src/utils/bootSession.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 冷启动会话标记(进程级、仅内存)。
|
||||
*
|
||||
* 目的:
|
||||
* - 在“随心”主题中实现:仅在冷启动时重置 base theme/seed
|
||||
* - 不落盘,避免污染 AsyncStorage
|
||||
*/
|
||||
let bootId: string | null = null;
|
||||
|
||||
export function getBootId(): string {
|
||||
if (bootId) return bootId;
|
||||
// 说明:无需加密强随机;只要在一次进程周期内稳定、不同冷启动尽量不同即可
|
||||
bootId = `${Date.now()}_${Math.random().toString(16).slice(2)}`;
|
||||
return bootId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user