This commit is contained in:
yumoqing 2024-10-09 16:06:04 +08:00
parent 804d52792a
commit 6dec5bee6a

View File

@ -48,14 +48,16 @@ params:
*/ */
bricks.uuid = function(){ bricks.uuid = function(){
return crypto.randomUUID(); var d = crypto.randomUUID();
var lst = d.split('-');
return list.join('');
} }
bricks.deviceid = function(appname){ bricks.deviceid = function(appname){
var deviceid = appname + 'deviceid'; var deviceid = appname + 'deviceid';
var id = localStorage.getItem(deviceid); var id = localStorage.getItem(deviceid);
if (!id){ if (!id){
id = crypto.randomUUID(); id = bricks.uuid();
localStorage.setItem(deviceid, id); localStorage.setItem(deviceid, id);
} }
return id; return id;