mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-18 00:16:37 +08:00
修复无法指定渠道id的问题
This commit is contained in:
parent
e1da1e31d5
commit
42469cb782
@ -91,11 +91,11 @@ func TokenAuth() func(c *gin.Context) {
|
|||||||
key = c.Request.Header.Get("mj-api-secret")
|
key = c.Request.Header.Get("mj-api-secret")
|
||||||
key = strings.TrimPrefix(key, "Bearer ")
|
key = strings.TrimPrefix(key, "Bearer ")
|
||||||
key = strings.TrimPrefix(key, "sk-")
|
key = strings.TrimPrefix(key, "sk-")
|
||||||
parts := strings.Split(key, "-")
|
parts = strings.Split(key, "-")
|
||||||
key = parts[0]
|
key = parts[0]
|
||||||
} else {
|
} else {
|
||||||
key = strings.TrimPrefix(key, "sk-")
|
key = strings.TrimPrefix(key, "sk-")
|
||||||
parts := strings.Split(key, "-")
|
parts = strings.Split(key, "-")
|
||||||
key = parts[0]
|
key = parts[0]
|
||||||
}
|
}
|
||||||
token, err := model.ValidateUserToken(key)
|
token, err := model.ValidateUserToken(key)
|
||||||
|
Loading…
Reference in New Issue
Block a user