Sfoglia il codice sorgente

修复uuid导致的创建失败问题

HuangKai 2 settimane fa
parent
commit
6b41eb177f
1 ha cambiato i file con 9 aggiunte e 2 eliminazioni
  1. 9 2
      src/model/AccountAuth.js

+ 9 - 2
src/model/AccountAuth.js

@@ -209,12 +209,19 @@ class AccountAuth {
         });        
     }
 
+    getIDByTime(){
+        let uuid = "sw" + Date.now().toString(36).slice(-8);
+        console.log(uuid);
+        return uuid;
+    }
+
     cteateMapData(user_id, map_name = 'map'){
         var sql = `INSERT INTO 
                     medba.dat_map 
-                        (map_name, map_data, user_id, update_time, create_time) 
+                        (map_name, map_data, user_id, update_time, create_time, map_uuid) 
                     VALUES 
-                        ('${map_name}', '{ "type": "FeatureCollection", "features": [], "center": { "x": 116.39639, "y": 39.91638 } }', ${user_id}, NOW(), NOW())`;
+                        ('${map_name}', '{ "type": "FeatureCollection", "features": [], "center": { "x": 116.39639, "y": 39.91638 } }', 
+                        ${user_id}, NOW(), NOW(), '${this.getIDByTime()}')`;
         var msg = {
             cmd: "update", // server端要进行判断的
             data: {