Kaynağa Gözat

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

loki.wu 11 ay önce
ebeveyn
işleme
5ef91355d5
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  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)