0417 0022
更新
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user