修改路由

This commit is contained in:
wucongxing 2023-09-04 15:35:49 +08:00
parent 7565212b5c
commit d72f27d7fa

View File

@ -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": "",
})