Skip to content

Commit 9f958ad

Browse files
author
piexlMax(奇淼
committed
fix(verify): 移除登录验证中的Captcha字段校验
refactor(validation): 强制字段名首字母大写并更新文档
1 parent 7a69b88 commit 9f958ad

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

server/mcp/gva_auto_generate.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func (t *AutomationModuleAnalyzer) New() mcp.Tool {
173173
"generateWeb": "是否生成前端(bool)",
174174
"generateServer": "是否生成后端(bool)",
175175
"fields": [{
176-
"fieldName": "字段名(string)",
176+
"fieldName": "字段名(string)必须大写开头",
177177
"fieldDesc": "字段描述(string)",
178178
"fieldType": "字段类型支持:string(字符串),richtext(富文本),int(整型),bool(布尔值),float64(浮点型),time.Time(时间),enum(枚举),picture(单图片,字符串),pictures(多图片,json字符串),video(视频,字符串),file(文件,json字符串),json(JSON),array(数组)",
179179
"fieldJson": "JSON标签(string)",
@@ -1243,6 +1243,14 @@ func (t *AutomationModuleAnalyzer) validateExecutionPlan(plan *ExecutionPlan) er
12431243
if field.FieldName == "" {
12441244
return fmt.Errorf("模块 %d 字段 %d 的 fieldName 不能为空", moduleIndex+1, i+1)
12451245
}
1246+
1247+
// 确保字段名首字母大写
1248+
if len(field.FieldName) > 0 {
1249+
firstChar := string(field.FieldName[0])
1250+
if firstChar >= "a" && firstChar <= "z" {
1251+
moduleInfo.Fields[i].FieldName = strings.ToUpper(firstChar) + field.FieldName[1:]
1252+
}
1253+
}
12461254
if field.FieldDesc == "" {
12471255
return fmt.Errorf("模块 %d 字段 %d 的 fieldDesc 不能为空", moduleIndex+1, i+1)
12481256
}

server/utils/verify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var (
55
ApiVerify = Rules{"Path": {NotEmpty()}, "Description": {NotEmpty()}, "ApiGroup": {NotEmpty()}, "Method": {NotEmpty()}}
66
MenuVerify = Rules{"Path": {NotEmpty()}, "Name": {NotEmpty()}, "Component": {NotEmpty()}, "Sort": {Ge("0")}}
77
MenuMetaVerify = Rules{"Title": {NotEmpty()}}
8-
LoginVerify = Rules{"CaptchaId": {NotEmpty()}, "Captcha": {NotEmpty()}, "Username": {NotEmpty()}, "Password": {NotEmpty()}}
8+
LoginVerify = Rules{"Username": {NotEmpty()}, "Password": {NotEmpty()}}
99
RegisterVerify = Rules{"Username": {NotEmpty()}, "NickName": {NotEmpty()}, "Password": {NotEmpty()}, "AuthorityId": {NotEmpty()}}
1010
PageInfoVerify = Rules{"Page": {NotEmpty()}, "PageSize": {NotEmpty()}}
1111
CustomerVerify = Rules{"CustomerName": {NotEmpty()}, "CustomerPhoneData": {NotEmpty()}}

0 commit comments

Comments
 (0)