Skip to content

Commit 25a996f

Browse files
author
piexlMax(奇淼
committed
fix: 新增字段在没有选择gvaModel的情况下,防止出现空指针
1 parent 9ba39f2 commit 25a996f

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

server/model/system/request/sys_auto_code.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,7 @@ func (r *AutoCode) Pretreatment() error {
188188
} // GvaModel
189189
{
190190
if r.IsAdd && r.PrimaryField == nil {
191-
r.PrimaryField = &AutoCodeField{
192-
FieldName: "",
193-
FieldType: "",
194-
FieldDesc: "",
195-
FieldJson: "",
196-
DataTypeLong: "",
197-
Comment: "",
198-
ColumnName: "",
199-
}
191+
r.PrimaryField = new(AutoCodeField)
200192
}
201193
} // 新增字段模式下不关注主键
202194
if r.Package == "" {

0 commit comments

Comments
 (0)