Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-11 15:54:51 +08:00
parent 459f84b208
commit e70b4d341c
12 changed files with 18 additions and 25 deletions

View File

@@ -382,10 +382,10 @@ abstract final class UserHttp {
}
}
static Future<LoadingState<double?>> getCoin() async {
static Future<LoadingState<double>> getCoin() async {
final res = await Request.get(Api.getCoin);
if (res.data['code'] == 0) {
return Success((res.data['data']?['money'] as num?)?.toDouble());
return Success((res.data['data']?['money'] as num?)?.toDouble() ?? 0.0);
} else {
return Error(res.data['message']);
}