app/lib/api/analytics.dart

22 lines
718 B
Dart
Raw Normal View History

2024-02-07 00:20:06 +08:00
import 'dart:convert';
import 'package:flutter/foundation.dart';
2024-01-29 20:44:00 +08:00
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
2024-02-07 19:32:36 +08:00
import 'package:starcitizen_doctor/common/io/rs_http.dart';
2023-10-30 20:39:31 +08:00
import 'package:starcitizen_doctor/common/utils/base_utils.dart';
class AnalyticsApi {
static touch(String key) async {
// debug 不统计
if (kDebugMode) return;
2023-10-30 20:39:31 +08:00
dPrint("AnalyticsApi.touch === $key start");
try {
2024-02-07 19:32:36 +08:00
await RSHttp.postData("${URLConf.xkeycApiHome}/analytics/$key",
data: utf8.encode(json.encode({"test": "a"})), contentType: "application/json");
2023-10-30 20:39:31 +08:00
dPrint("AnalyticsApi.touch === $key over");
} catch (e) {
dPrint("AnalyticsApi.touch === $key Error:$e");
}
}
}