Compare commits
2 Commits
196887fa8b
...
008cbc653a
| Author | SHA1 | Date |
|---|---|---|
|
|
008cbc653a | |
|
|
ab2f5fd1b7 |
14
main.go
14
main.go
|
|
@ -106,11 +106,15 @@ func JWTAuthMiddleware() gin.HandlerFunc {
|
|||
tokenString = c.Query("token")
|
||||
}
|
||||
//如果请求为login或register,则不需要验证token
|
||||
for k, _ := range proto.Url_map {
|
||||
if strings.Contains(c.Request.URL.Path, k) {
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
//for k, _ := range proto.Url_map {
|
||||
// if strings.Contains(c.Request.URL.Path, k) {
|
||||
// c.Next()
|
||||
// return
|
||||
// }
|
||||
//}
|
||||
if proto.Url_map[c.Request.URL.Path] == true { //查看是否在不需要token的url中
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
if tokenString == "" {
|
||||
//c.AbortWithStatus(200)
|
||||
|
|
|
|||
Loading…
Reference in New Issue