mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-24 12:32:55 +08:00
fix(webconsole): require rdp input password (#22397)
This commit is contained in:
@@ -335,7 +335,7 @@ func handleServerRemoteRDPConsole(ctx context.Context, w http.ResponseWriter, r
|
||||
httperrors.GeneralServerError(ctx, w, err)
|
||||
return
|
||||
}
|
||||
handleDataSession(ctx, info, w, "rdp", url.Values{"password": {info.GetPassword()}}, true)
|
||||
handleDataSession(ctx, info, w, "rdp", url.Values{"password": {info.GetPassword()}}, false)
|
||||
}
|
||||
|
||||
func responsePublicCloudConsole(ctx context.Context, info *session.RemoteConsoleInfo, w http.ResponseWriter) {
|
||||
|
||||
@@ -69,9 +69,6 @@ func NewRemoteRDPConsoleInfoByCloud(ctx context.Context, s *mcclient.ClientSessi
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !ret.Contains("username") || !ret.Contains("password") {
|
||||
return nil, httperrors.NewMissingParameterError("username")
|
||||
}
|
||||
info.Password, _ = ret.GetString("password")
|
||||
info.Username, _ = ret.GetString("username")
|
||||
}
|
||||
@@ -99,6 +96,9 @@ func (info *RemoteRDPConsoleInfo) Scan(byte, func(string)) {
|
||||
}
|
||||
|
||||
func (info *RemoteRDPConsoleInfo) IsNeedLogin() (bool, error) {
|
||||
if len(info.Username) == 0 || len(info.Password) == 0 {
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user