Browse Source

更新rpc.dart

felix 1 year ago
parent
commit
0b818828b1
1 changed files with 20 additions and 0 deletions
  1. 20 0
      rpc.txt

+ 20 - 0
rpc.txt

@@ -1,9 +1,11 @@
 library fis_jsonrpc;
 
 import 'dart:collection';
+import 'dart:convert';
 
 import 'package:fis_common/extensions/type.dart';
 import 'package:fis_common/logger/logger.dart';
+import 'package:fis_jsonrpc/encrpyt.dart';
 
 import 'client_base.dart';
 import 'interceptor.dart';
@@ -44,6 +46,24 @@ class JsonRpcProxy {
 
   static PlatformService? _platformService;
 
+  /// 请求加密配置
+  JsonRpcEncryptConfig get requestEncryptConfig =>
+      JsonRpcClientBase.requestEncryptConfig;
+  set requestEncryptConfig(JsonRpcEncryptConfig config) {
+    JsonRpcClientBase.requestEncryptConfig = config;
+    final cfgJson = jsonEncode(config.toJson());
+    logger.i("JsonRpcProxy - set RequestEncryptConfig: $cfgJson.");
+  }
+
+  /// 响应加密配置
+  JsonRpcEncryptConfig get responseEncryptConfig =>
+      JsonRpcClientBase.responseEncryptConfig;
+  set responseEncryptConfig(JsonRpcEncryptConfig config) {
+    JsonRpcClientBase.responseEncryptConfig = config;
+    final cfgJson = jsonEncode(config.toJson());
+    logger.i("JsonRpcProxy - set ResponseEncryptConfig: $cfgJson.");
+  }
+
   /* 服务代理设置 Start */
 
   /// 平台服务