fix: fix MySQL syntax error (#54)
This commit is contained in:
1 parent
a751f30316
commit
4bcc5f54f2
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -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