Showing
1 changed file
with
3 additions
and
4 deletions
| @@ -135,10 +135,9 @@ class AutoTrackQueue { | @@ -135,10 +135,9 @@ class AutoTrackQueue { | ||
| 135 | 135 | ||
| 136 | if (host != null) { | 136 | if (host != null) { |
| 137 | List<Map> datas = []; | 137 | List<Map> datas = []; |
| 138 | - uploadList.forEach((event) { | 138 | + for (var event in uploadList) { |
| 139 | Random random = Random.secure(); | 139 | Random random = Random.secure(); |
| 140 | int id = random.nextInt(1 << 32); // 模拟 Java 的 nextInt() | 140 | int id = random.nextInt(1 << 32); // 模拟 Java 的 nextInt() |
| 141 | - final t = DateTime.now().millisecondsSinceEpoch; | ||
| 142 | 141 | ||
| 143 | String os = ""; | 142 | String os = ""; |
| 144 | String os_version = ""; | 143 | String os_version = ""; |
| @@ -212,7 +211,7 @@ class AutoTrackQueue { | @@ -212,7 +211,7 @@ class AutoTrackQueue { | ||
| 212 | 211 | ||
| 213 | datas.add({ | 212 | datas.add({ |
| 214 | '_track_id': id, | 213 | '_track_id': id, |
| 215 | - 'time': t, | 214 | + 'time': event.time, |
| 216 | 'type': 'track', | 215 | 'type': 'track', |
| 217 | 'distinct_id': | 216 | 'distinct_id': |
| 218 | config.userId ?? AutoTrackConfigManager.instance.deviceId, | 217 | config.userId ?? AutoTrackConfigManager.instance.deviceId, |
| @@ -222,7 +221,7 @@ class AutoTrackQueue { | @@ -222,7 +221,7 @@ class AutoTrackQueue { | ||
| 222 | }); | 221 | }); |
| 223 | 222 | ||
| 224 | AutoTrackLogger.getInstance().debug('upload => data => $datas'); | 223 | AutoTrackLogger.getInstance().debug('upload => data => $datas'); |
| 225 | - }); | 224 | + } |
| 226 | 225 | ||
| 227 | try { | 226 | try { |
| 228 | final httpClient = HttpClient(); | 227 | final httpClient = HttpClient(); |
-
Please register or login to post a comment