Browse Source

修复可能出现类型转换失败的问题

loki.wu 11 tháng trước cách đây
mục cha
commit
5ef91355d5
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      lib/client_base.dart

+ 3 - 1
lib/client_base.dart

@@ -86,7 +86,9 @@ class JsonRpcClientBase {
 
       var response = await _postRequest(package);
       if (response == null) throw JsonRpcException(message: "Response Empty");
-
+      if (response is String) {
+        response = jsonDecode(response);
+      }
       result = await _handleDecoded(response);
     } catch (e) {
       if (e is FHttpError)