0417 0022

更新
This commit is contained in:
spasolreisa
2026-04-17 00:22:43 +08:00
parent 9ce601aa8d
commit fed18d264a
12 changed files with 1924 additions and 210 deletions

View File

@@ -193,4 +193,32 @@ class UserProvider with ChangeNotifier {
}
notifyListeners();
}
Future<void> syncSegaScore(Map<String, dynamic> data) async {
if (_token == null || _user == null) {
throw "请先登录";
}
if (_selectedSegaId == null || _selectedSegaId!.isEmpty) {
throw "请先选择要同步的 SegaID";
}
try {
// 调用上传
final result = await UserService.uploadSegaRating(
_token!,
_selectedSegaId!,
data,
);
if (result["code"] == 200) {
print("✅ 同步成功:${result["msg"]}");
} else {
print("❌ 同步失败:${result["msg"]}");
throw result["msg"] ?? "同步失败";
}
} catch (e) {
print("❌ 同步异常:$e");
rethrow;
}
}
}