Skip to content

Commit

Permalink
修复无法指定渠道id的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcium-Ion committed Dec 14, 2023
1 parent e1da1e3 commit 42469cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions middleware/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ func TokenAuth() func(c *gin.Context) {
key = c.Request.Header.Get("mj-api-secret")
key = strings.TrimPrefix(key, "Bearer ")
key = strings.TrimPrefix(key, "sk-")
parts := strings.Split(key, "-")
parts = strings.Split(key, "-")
key = parts[0]
} else {
key = strings.TrimPrefix(key, "sk-")
parts := strings.Split(key, "-")
parts = strings.Split(key, "-")
key = parts[0]
}
token, err := model.ValidateUserToken(key)
Expand Down

0 comments on commit 42469cb

Please sign in to comment.