功能:同步小程序流程

This commit is contained in:
xiaowang
2026-05-23 18:45:41 +08:00
parent 844516988b
commit 30ae763e18
117 changed files with 8823 additions and 76 deletions
+8
View File
@@ -1,10 +1,18 @@
const { STORAGE_KEYS, getStorage, setStorage } = require('./storage')
/**
* Purpose: createDeviceId supports device.js by holding or executing the create device id page or API role.
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
*/
function createDeviceId() {
const randomText = Math.random().toString(36).slice(2, 10)
return `mini-device-${Date.now()}-${randomText}`
}
/**
* Purpose: getDeviceId supports device.js by holding or executing the get device id page or API role.
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
*/
function getDeviceId() {
let value = getStorage(STORAGE_KEYS.DEVICE_ID, '')
if (value) {