Quellcode durchsuchen

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

HuangKai vor 2 Wochen
Ursprung
Commit
6b41eb177f
1 geänderte Dateien mit 9 neuen und 2 gelöschten Zeilen
  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: {