Explorar el Código

修改deviceId

Michael Wang hace 4 años
padre
commit
0088199575
Se han modificado 1 ficheros con 3 adiciones y 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");