mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +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/extension.dart';
|
||||
import 'package:PiliPlus/utils/request_utils.dart';
|
||||
import 'package:PiliPlus/utils/wbi_sign.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
@@ -118,9 +119,11 @@ class SearchHttp {
|
||||
// break;
|
||||
}
|
||||
return Success(data);
|
||||
} catch (err) {
|
||||
debugPrint(err.toString());
|
||||
return Error(err.toString());
|
||||
} catch (e, s) {
|
||||
if (kDebugMode) {
|
||||
rethrow;
|
||||
}
|
||||
return Error('$e\n\n$s');
|
||||
}
|
||||
} else {
|
||||
return Error(resData['message'], code: resData['code']);
|
||||
@@ -164,9 +167,11 @@ class SearchHttp {
|
||||
if (res.data['code'] == 0) {
|
||||
try {
|
||||
return Success(SearchAllData.fromJson(res.data['data']));
|
||||
} catch (err) {
|
||||
debugPrint(err.toString());
|
||||
return Error(err.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