xcLoginAndGetDeviceList method

Future<Map<String, dynamic>> xcLoginAndGetDeviceList({
  1. required String userName,
  2. required String pwd,
})

登录账号并获取设备列表 userName 用户名 pwd密码 return Map

Implementation

Future<Map<String, dynamic>> xcLoginAndGetDeviceList(
    {required String userName, required String pwd}) async {
  final originResponse =
      await _api.loginAndGetDevList(userName, pwd, ApiSeq.instance.getSeq());

  XCloudResponse<Map<String, dynamic>> response =
      XCloudResponse.fromOriginResponse<Map<String, dynamic>>(originResponse);
  if (!response.success) {
    return Future.error(XCloudAPIException(
        code: response.code, commandId: originResponse.commandId));
  }
  return Future.value(response.data);
}