mirror of
https://github.com/songquanpeng/one-api.git
synced 2026-01-23 23:36:49 +08:00
feat: 余额不足提示中文增强引导性
This commit is contained in:
@@ -173,9 +173,9 @@ func RelayImageHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
|
||||
userQuota, err := model.CacheGetUserQuota(ctx, meta.UserId)
|
||||
|
||||
quota := int64(ratio*imageCostRatio*1000) * int64(imageRequest.N)
|
||||
|
||||
// Check if user quota is enough Message prompts the user to use Chinese
|
||||
if userQuota-quota < 0 {
|
||||
return openai.ErrorWrapper(errors.New("user quota is not enough"), "insufficient_user_quota", http.StatusForbidden)
|
||||
return openai.ErrorWrapper(errors.New("请移步充值页面进行充值,可在日志中查阅使用明细"), "insufficient_user_quota", http.StatusForbidden)
|
||||
}
|
||||
|
||||
// do request
|
||||
|
||||
Reference in New Issue
Block a user