diff --git a/api/middlewares/auth.go b/api/middlewares/auth.go index 20e7ce7..bfe0bdb 100644 --- a/api/middlewares/auth.go +++ b/api/middlewares/auth.go @@ -18,7 +18,7 @@ import ( // Auth Auth认证 func Auth() gin.HandlerFunc { return func(c *gin.Context) { - appId := c.Request.Header.Get("app_id") + appId := c.Request.Header.Get("appId") if appId == "" { c.JSON(http.StatusUnauthorized, gin.H{ "message": "请求未授权", @@ -44,13 +44,13 @@ func Auth() gin.HandlerFunc { openKeyDao := dao.OpenKeyDao{} openKey, err := openKeyDao.GetOpenKeyByDoctorId(appId) if err != nil || openKey == nil { - responses.FailWithMessage("非法app_id", c) + responses.FailWithMessage("非法appId", c) c.Abort() return } if openKey.Status != 1 { - responses.FailWithMessage("非法app_id", c) + responses.FailWithMessage("非法appId", c) c.Abort() return } @@ -58,7 +58,7 @@ func Auth() gin.HandlerFunc { paramsRaw, ok := c.Get("params") if !ok { c.JSON(http.StatusInternalServerError, gin.H{ - "message": "Invalid params type1", + "message": "Invalid params type", "code": consts.ServerError, "data": "", })