|
@@ -1,7 +1,6 @@
|
|
package middleware
|
|
package middleware
|
|
|
|
|
|
import (
|
|
import (
|
|
- "dcl_dispatch_server/src/package/config/c_log"
|
|
|
|
"dcl_dispatch_server/src/package/entity"
|
|
"dcl_dispatch_server/src/package/entity"
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/gin-gonic/gin"
|
|
"net/http"
|
|
"net/http"
|
|
@@ -14,7 +13,6 @@ func ValidateHeaders(whiteList []string, webToken string) gin.HandlerFunc {
|
|
if isNotWhite(c.Request.URL.Path, whiteList) {
|
|
if isNotWhite(c.Request.URL.Path, whiteList) {
|
|
acceptToken := c.GetHeader("Authorization")
|
|
acceptToken := c.GetHeader("Authorization")
|
|
if acceptToken == "" || acceptToken != webToken {
|
|
if acceptToken == "" || acceptToken != webToken {
|
|
- c_log.GlobalLogger.Errorf("请求头 Authorization 校验失败:%v --> %v", acceptToken, webToken)
|
|
|
|
c.JSON(http.StatusOK, entity.HttpResult{Status: false, Code: "1001", Message: "请求头 Authorization 校验失败。"})
|
|
c.JSON(http.StatusOK, entity.HttpResult{Status: false, Code: "1001", Message: "请求头 Authorization 校验失败。"})
|
|
c.Abort()
|
|
c.Abort()
|
|
return
|
|
return
|