JS 生成uuid

const uuid = () => {
  const tempUrl = URL.createObjectURL(new Blob());
  const tempId = tempUrl.toString(); // blob:https://xxx.com/b250d159-e1b6-4a87-9002-885d90033be3
  URL.revokeObjectURL(tempUrl);
  return tempId.substr(tempId.lastIndexOf("/") + 1);
}

 

posted @ 2021-12-28 18:19  一路向北√  阅读(343)  评论(0编辑  收藏  举报

web应用开发&研究 -

业精于勤而荒于嬉。

工作,使我快乐。


Font Awesome | Respond.js | Bootstrap中文网