mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-11 00:23:42 +08:00
修复令牌添加、搜索bug
This commit is contained in:
@@ -34,7 +34,7 @@ func SearchUserTokens(userId int, keyword string, token string) (tokens []*Token
|
||||
if token != "" {
|
||||
token = strings.Trim(token, "sk-")
|
||||
}
|
||||
err = DB.Where("user_id = ?", userId).Where("name LIKE ?", keyword+"%").Where("`key` LIKE ?", token+"%").Find(&tokens).Error
|
||||
err = DB.Where("user_id = ?", userId).Where("name LIKE ?", "%"+keyword+"%").Where("`key` LIKE ?", "%"+token+"%").Find(&tokens).Error
|
||||
return tokens, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user