This commit is contained in:
2025-06-17 15:56:05 +08:00
parent 417d0671de
commit b171122a32
8 changed files with 40 additions and 41 deletions

View File

@@ -93,7 +93,7 @@ func (a *app) edit(w http.ResponseWriter, r *http.Request) {
}
func (a *app) save(w http.ResponseWriter, r *http.Request) {
id := convertor.ConvertInt[int32](r.PostFormValue("ID"), 0)
id := convertor.Int[int32](r.PostFormValue("ID"), 0)
name := r.PostFormValue("Name")
displayName := r.PostFormValue("DisplayName")
t := r.PostFormValue("Type")
@@ -103,11 +103,11 @@ func (a *app) save(w http.ResponseWriter, r *http.Request) {
}
avatar := r.PostFormValue("Avatar")
style := r.PostFormValue("Style")
parentID := convertor.ConvertInt[int32](r.PostFormValue("ParentID"), 0)
visible := convertor.ConvertBool(r.PostFormValue("Visible"), false)
isList := convertor.ConvertBool(r.PostFormValue("IsList"), false)
sort := convertor.ConvertInt[int32](r.PostFormValue("Sort"), 6666)
status := convertor.ConvertInt[int32](r.PostFormValue("Status"), 0)
parentID := convertor.Int[int32](r.PostFormValue("ParentID"), 0)
visible := convertor.Bool(r.PostFormValue("Visible"), false)
isList := convertor.Bool(r.PostFormValue("IsList"), false)
sort := convertor.Int[int32](r.PostFormValue("Sort"), 6666)
status := convertor.Int[int32](r.PostFormValue("Status"), 0)
ctx := r.Context()
if len(avatar) > 0 && !strings.Contains(avatar, "layui-icon ") {