From a0d4dfd0eb41913e9fd12cf0253b4181c4299194 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Sun, 28 Feb 2021 16:43:15 +0800 Subject: [PATCH] fix exist --- server/http.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/http.go b/server/http.go index 05341d3..8edf61c 100644 --- a/server/http.go +++ b/server/http.go @@ -23,7 +23,7 @@ type httpServer struct { engine *gin.Engine bot *coolq.CQBot HTTP *http.Server - api *apiCaller + api apiCaller } type httpClient struct { @@ -46,7 +46,7 @@ func (s *httpServer) Run(addr, authToken string, bot *coolq.CQBot) { gin.SetMode(gin.ReleaseMode) s.engine = gin.New() s.bot = bot - s.api = &apiCaller{s.bot} + s.api = apiCaller{s.bot} s.engine.Use(func(c *gin.Context) { if c.Request.Method != "GET" && c.Request.Method != "POST" { log.Warnf("已拒绝客户端 %v 的请求: 方法错误", c.Request.RemoteAddr) @@ -182,7 +182,7 @@ func (h httpContext) Get(k string) gjson.Result { } } } - return gjson.Result{Type: gjson.String, Str: ""} + return gjson.Result{Type: gjson.Null, Str: ""} } func (s *httpServer) ShutDown() {