init
This commit is contained in:
8
hbuilder_app/common/device.js
Normal file
8
hbuilder_app/common/device.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export function getDeviceId() {
|
||||
let id = uni.getStorageSync('deviceId')
|
||||
if (!id) {
|
||||
id = 'dev_' + Math.random().toString(16).slice(2) + Date.now().toString(16)
|
||||
uni.setStorageSync('deviceId', id)
|
||||
}
|
||||
return id
|
||||
}
|
||||
Reference in New Issue
Block a user