优化
This commit is contained in:
parent
2ddba3c31f
commit
6e7a2cc9ba
2 changed files with 2 additions and 2 deletions
2
main.go
2
main.go
|
@ -20,7 +20,7 @@ func handlePost(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Error(w, "Error reading request body", http.StatusBadRequest)
|
http.Error(w, "Error reading request body", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Println("handlePost:", string(body))
|
// fmt.Println("handlePost:", string(body))
|
||||||
// 解码 JSON 数据到 map[string]interface{} 类型的变量
|
// 解码 JSON 数据到 map[string]interface{} 类型的变量
|
||||||
var data map[string]interface{}
|
var data map[string]interface{}
|
||||||
err = json.Unmarshal(body, &data)
|
err = json.Unmarshal(body, &data)
|
||||||
|
|
|
@ -27,7 +27,7 @@ func Router(data map[string]interface{}) {
|
||||||
worker := workers.NewWorker(parms, fmt.Sprintf("%d", int(uid)), fmt.Sprintf("%d", int(gid)), role, fmt.Sprintf("%d", int(mid)), raw_msg)
|
worker := workers.NewWorker(parms, fmt.Sprintf("%d", int(uid)), fmt.Sprintf("%d", int(gid)), role, fmt.Sprintf("%d", int(mid)), raw_msg)
|
||||||
|
|
||||||
// fmt.Println("router:", parms[0])
|
// fmt.Println("router:", parms[0])
|
||||||
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 == "0" {
|
||||||
|
|
Loading…
Reference in a new issue