rpc_bridge.dart 467 B

123456789101112131415161718192021
  1. // ignore_for_file: constant_identifier_names
  2. import 'package:fis_jsonrpc/rpc.dart';
  3. import 'package:get/get.dart';
  4. /// 需要在主项目先 Put,需要随时维护 token
  5. class RPCBridge {
  6. static RPCBridge get ins => Get.find<RPCBridge>();
  7. final JsonRpcProxy _rpc;
  8. String _userToken = "";
  9. RPCBridge(this._rpc, this._userToken);
  10. JsonRpcProxy get rpc => _rpc;
  11. String get token => _userToken;
  12. setToken(String token) {
  13. _userToken = token;
  14. }
  15. }