🐛 修复会话打开黑屏.

This commit is contained in:
lijiahangmax
2025-07-10 03:32:45 +08:00
parent d2cba947b3
commit b42645b0ce
9 changed files with 43 additions and 16 deletions

View File

@@ -62,6 +62,7 @@ public class HostVncConfigStrategy extends AbstractHostConfigStrategy<HostVncCon
.authType(HostAuthTypeEnum.PASSWORD.name())
.noUsername(false)
.noPassword(false)
.timezone("Asia/Shanghai")
.clipboardEncoding(Const.UTF_8)
.build();
}
@@ -94,7 +95,11 @@ public class HostVncConfigStrategy extends AbstractHostConfigStrategy<HostVncCon
afterModel.setAuthType(HostAuthTypeEnum.PASSWORD.name());
}
// 加密密码
this.checkEncryptPassword(afterModel.getAuthType(), beforeModel, afterModel);
if (Booleans.isTrue(afterModel.getNoPassword())) {
afterModel.setPassword(beforeModel.getPassword());
} else {
this.checkEncryptPassword(afterModel.getAuthType(), beforeModel, afterModel);
}
afterModel.setHasPassword(null);
afterModel.setUseNewPassword(null);
}

View File

@@ -277,6 +277,9 @@ public class TerminalConnectHandler extends AbstractTerminalHandler<ITerminalSen
} else if (TerminalConnectTypeEnum.RDP.name().equals(connectType)) {
// RDP
connectConfig = hostConnectApi.getRdpConnectConfig(host, userId);
} else if (TerminalConnectTypeEnum.VNC.name().equals(connectType)) {
// VNC
connectConfig = hostConnectApi.getVncConnectConfig(host, userId);
} else {
throw Exceptions.unsupported();
}