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)