mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-12 11:23:42 +08:00
feat: change default token prefix to laisky-
- Remove prefix "laisky-" from the variable "key" in [middleware/auth.go] - Modify error message from "用户已被封禁" to "用户已被禁用" in [middleware/auth.go] - Remove check for "consumeQuota" when request URL starts with "/v1/models" in [middleware/auth.go] - Add ability for admin users to set "channelId" in context in [middleware/auth.go] - Update URL and key for `ama` and `opencat` links, and key format for `url` in links in [web/src/components/TokensTable.js] - Update URL for `nextUrl` in [web/src/components/TokensTable.js] - Change variable names and improve search function for token names in [web/src/components/TokensTable.js] - Add delete confirmation popup, copy and open link buttons, sorting functionality for column header, and loading state in [web/src/components/TokensTable.js] - Update pagination to load more data in [web/src/components/TokensTable.js] - Update rendering of token information, including quota and timestamp in [web/src/components/TokensTable.js]
This commit is contained in:
@@ -86,7 +86,7 @@ func TokenAuth() func(c *gin.Context) {
|
||||
return func(c *gin.Context) {
|
||||
key := c.Request.Header.Get("Authorization")
|
||||
key = strings.TrimPrefix(key, "Bearer ")
|
||||
key = strings.TrimPrefix(key, "sk-")
|
||||
key = strings.TrimPrefix(strings.TrimPrefix(key, "sk-"), "laisky-")
|
||||
parts := strings.Split(key, "-")
|
||||
key = parts[0]
|
||||
token, err := model.ValidateUserToken(key)
|
||||
|
||||
Reference in New Issue
Block a user