feat: able to display quota in dollar

This commit is contained in:
JustSong
2023-06-20 20:09:17 +08:00
parent b220e8e863
commit a6cc0226a7
19 changed files with 125 additions and 45 deletions
+2 -2
View File
@@ -16,12 +16,12 @@ const (
func CacheGetTokenByKey(key string) (*Token, error) {
var token Token
if !common.RedisEnabled {
err := DB.Where("`key` = ?", key).First(token).Error
err := DB.Where("`key` = ?", key).First(&token).Error
return &token, err
}
tokenObjectString, err := common.RedisGet(fmt.Sprintf("token:%s", key))
if err != nil {
err := DB.Where("`key` = ?", key).First(token).Error
err := DB.Where("`key` = ?", key).First(&token).Error
if err != nil {
return nil, err
}