mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-25 13:00:14 +08:00
fix parse dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -14,6 +14,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:encrypt/encrypt.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
|
||||
class LoginHttp {
|
||||
static final String deviceId = LoginUtils.genDeviceId();
|
||||
@@ -46,8 +47,11 @@ class LoginHttp {
|
||||
try {
|
||||
final Map<String, dynamic> data = res.data['data'];
|
||||
return Success((authCode: data['auth_code'], url: data['url']));
|
||||
} catch (e) {
|
||||
return Error(e.toString());
|
||||
} catch (e, s) {
|
||||
if (kDebugMode) {
|
||||
rethrow;
|
||||
}
|
||||
return Error('$e\n\n$s');
|
||||
}
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
|
||||
Reference in New Issue
Block a user