Explorar o código

修改deviceId

Michael Wang %!s(int64=4) %!d(string=hai) anos
pai
achega
0088199575
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/constant/constants.js

+ 3 - 1
src/constant/constants.js

@@ -1,8 +1,10 @@
+import MD5 from "js-md5";
+
 export const YYYYMMDDHHmmss = "YYYY-MM-DD HH:mm:ss";
 export const PLATFORM = "WEB";
 
 if (!localStorage.getItem("deviceId")) {
-  localStorage.setItem("deviceId", Math.random() + "-" + Date.now());
+  localStorage.setItem("deviceId", MD5(Math.random() + "-" + Date.now()));
 }
 export const DEVICE_ID = localStorage.getItem("deviceId");