修复无法指定渠道id的问题
Some checks failed
Publish Docker image (amd64, English) / Push Docker image to multiple registries (push) Has been cancelled
Publish Docker image (arm64) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled

This commit is contained in:
CaIon 2023-12-14 16:43:20 +08:00
parent a12421ebe2
commit 3b0b139c49

View File

@ -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)