xcDeviceResetPwdNotLogin method
密保问题通过后,重置设备密码
Implementation
Future<dynamic> xcDeviceResetPwdNotLogin(
{required String deviceId,
required String userName,
required String pwd}) async {
DeviceSetNewPasswordModel deviceSetNewPasswordModel =
DeviceSetNewPasswordModel();
deviceSetNewPasswordModel.name = 'SetNewPassword';
deviceSetNewPasswordModel.sessionID = '0x00000002';
SetNewPassword setNewPassword = SetNewPassword();
setNewPassword.userName = userName;
setNewPassword.newPassword = pwd;
deviceSetNewPasswordModel.setNewPassword = setNewPassword;
final String commandJs = jsonEncode(deviceSetNewPasswordModel.toJson());
final result = await _api.xcDeviceSystemConfigNotLogin(
deviceId,
deviceSetNewPasswordModel.name!,
commandJs,
commandJs.length,
1650,
15000,
ApiSeq.instance.getSeq());
if (kDebugMode) {
XCloudResponse.fromOriginResponse(result);
}
if (result.param1 < 0) {
return Future.error(
XCloudAPIException(code: result.param1, commandId: result.commandId));
}
if (result.byteStream == null) {
return {};
}
String byteString = XCloudResponse.byteToString(result.byteStream);
return json.decode(byteString);
}