SSH认证--私钥认证方式增加用户名选项

This commit is contained in:
GoEdgeLab
2021-06-30 14:55:21 +08:00
parent d03bdfe203
commit ea358ad348
6 changed files with 33 additions and 2 deletions

View File

@@ -42,6 +42,9 @@ func (this *CreateAction) RunPost(params struct {
this.FailField("username", "请输入SSH登录用户名")
}
case "privateKey":
if len(params.Username) == 0 {
this.FailField("username", "请输入SSH登录用户名")
}
if len(params.PrivateKey) == 0 {
this.FailField("privateKey", "请输入RSA私钥")
}

View File

@@ -74,6 +74,9 @@ func (this *UpdateAction) RunPost(params struct {
this.FailField("username", "请输入SSH登录用户名")
}
case "privateKey":
if len(params.Username) == 0 {
this.FailField("username", "请输入SSH登录用户名")
}
if len(params.PrivateKey) == 0 {
this.FailField("privateKey", "请输入RSA私钥")
}