From 803332d69d957abedc6dc04793a415811d3883e9 Mon Sep 17 00:00:00 2001 From: liyp Date: Mon, 1 Jul 2024 10:32:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(router):=20=E4=BF=AE=E6=94=B9=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=A3=80=E6=9F=A5=E7=9A=84=E8=BF=94=E5=9B=9E=E5=80=BC?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.go | 8 ++++---- utils/router.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/config.go b/config/config.go index f989a22..148358d 100644 --- a/config/config.go +++ b/config/config.go @@ -15,8 +15,8 @@ var ( ) func loadConfig() { - mu.Lock() - defer mu.Unlock() + // mu.Lock() + // defer mu.Unlock() if _, err := toml.DecodeFile("config.toml", &config); err != nil { panic(err) @@ -24,8 +24,8 @@ func loadConfig() { } func GetConfig() map[string]interface{} { - // mu.Lock() - // defer mu.Unlock() + mu.Lock() + defer mu.Unlock() // print(config) if config == nil { loadConfig() diff --git a/utils/router.go b/utils/router.go index 7a9cf2e..2bc834e 100644 --- a/utils/router.go +++ b/utils/router.go @@ -36,7 +36,7 @@ func Router(data map[string]interface{}) { // fmt.Println("CheckPermission:", worker.CheckPermission()) // ans := NewStdAns(parms[0], fmt.Sprintf("%d", int(uid)), fmt.Sprintf("%d", int(gid)), role, fmt.Sprintf("%d", int(mid)), raw_msg) message := worker.CheckPermission() - if message == "0" { + if message == "ok" { message = worker.GetMsg() worker.SendMsg(message)