From 117a3e5d9053cc41bd237527aac3870c3370fe6e Mon Sep 17 00:00:00 2001 From: mklee Date: Fri, 8 Sep 2023 18:24:17 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9D=B4=EB=AF=BC=EC=9A=B0]=20=EC=BA=90?= =?UTF-8?q?=EB=A6=AD=ED=84=B0=20=EC=83=9D=EC=84=B1=20=EC=A0=9C=ED=95=9C=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(=EB=8C=80=EC=8B=A0=20=EC=BB=A4=EB=B0=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/api.go | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/core/api.go b/core/api.go index cef7d58..4a407e6 100644 --- a/core/api.go +++ b/core/api.go @@ -403,18 +403,23 @@ func (caller apiCaller) lockcreatecharAPI(w http.ResponseWriter, r *http.Request return err } - curregion, _ := gocommon.ReadStringFormValue(r.Form, "region") + haschr, _ := gocommon.ReadStringFormValue(r.Form, "haschr") - locked := map[string]any{ - "lock": false, - } + locked := make(map[string]any) + if haschr == "true" { + locked["lock"] = false + } else { + curregion, _ := gocommon.ReadStringFormValue(r.Form, "region") - for _, regioninfo := range mg { - region := regioninfo["divisions"].(primitive.M) - for idx, rl := range region { - if idx == curregion { - if rl.(primitive.M)["lockcreatechar"].(bool) { - locked["lock"] = true + for _, regioninfo := range mg { + region := regioninfo["divisions"].(primitive.M) + for idx, rl := range region { + if idx == curregion { + if rl.(primitive.M)["lockcreatechar"].(bool) { + locked["lock"] = true + } else { + locked["lock"] = false + } } } }