mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-18 17:51:28 +00:00
chore: update api message
This commit is contained in:
@@ -34,7 +34,7 @@ func SearchUserTokens(userId int, keyword string) (tokens []*Token, err error) {
|
|||||||
|
|
||||||
func ValidateUserToken(key string) (token *Token, err error) {
|
func ValidateUserToken(key string) (token *Token, err error) {
|
||||||
if key == "" {
|
if key == "" {
|
||||||
return nil, errors.New("未提供 token")
|
return nil, errors.New("未提供令牌")
|
||||||
}
|
}
|
||||||
token, err = CacheGetTokenByKey(key)
|
token, err = CacheGetTokenByKey(key)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -66,7 +66,7 @@ func ValidateUserToken(key string) (token *Token, err error) {
|
|||||||
}()
|
}()
|
||||||
return token, nil
|
return token, nil
|
||||||
}
|
}
|
||||||
return nil, errors.New("无效的 token")
|
return nil, errors.New("无效的令牌")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetTokenByIds(id int, userId int) (*Token, error) {
|
func GetTokenByIds(id int, userId int) (*Token, error) {
|
||||||
|
Reference in New Issue
Block a user