mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-05 08:13:43 +08:00
fix: fix MySQL syntax error (#54)
This commit is contained in:
@@ -39,7 +39,7 @@ func ValidateUserToken(key string) (token *Token, err error) {
|
||||
}
|
||||
key = strings.Replace(key, "Bearer ", "", 1)
|
||||
token = &Token{}
|
||||
err = DB.Where("key = ?", key).First(token).Error
|
||||
err = DB.Where("`key` = ?", key).First(token).Error
|
||||
if err == nil {
|
||||
if token.Status != common.TokenStatusEnabled {
|
||||
return nil, errors.New("该 token 状态不可用")
|
||||
|
||||
Reference in New Issue
Block a user