fix(router): 修改权限检查的返回值关键字

This commit is contained in:
liyp 2024-07-01 10:32:56 +08:00
parent def02d4e3a
commit 803332d69d
2 changed files with 5 additions and 5 deletions

View file

@ -15,8 +15,8 @@ var (
) )
func loadConfig() { func loadConfig() {
mu.Lock() // mu.Lock()
defer mu.Unlock() // defer mu.Unlock()
if _, err := toml.DecodeFile("config.toml", &config); err != nil { if _, err := toml.DecodeFile("config.toml", &config); err != nil {
panic(err) panic(err)
@ -24,8 +24,8 @@ func loadConfig() {
} }
func GetConfig() map[string]interface{} { func GetConfig() map[string]interface{} {
// mu.Lock() mu.Lock()
// defer mu.Unlock() defer mu.Unlock()
// print(config) // print(config)
if config == nil { if config == nil {
loadConfig() loadConfig()

View file

@ -36,7 +36,7 @@ func Router(data map[string]interface{}) {
// fmt.Println("CheckPermission:", worker.CheckPermission()) // 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) // 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() message := worker.CheckPermission()
if message == "0" { if message == "ok" {
message = worker.GetMsg() message = worker.GetMsg()
worker.SendMsg(message) worker.SendMsg(message)