Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Oct 9, 2023
1 parent 5e9426b commit a71845f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions auth/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,17 @@ func ReduceDalle(db *sql.DB, user *User) bool {
}

func CanEnableModel(db *sql.DB, user *User, model string) bool {
auth := user != nil
switch model {
case globals.GPT4, globals.GPT40613, globals.GPT40314:
return auth && user.GetQuota(db) >= 5
return user != nil && user.GetQuota(db) >= 5
case globals.GPT432k, globals.GPT432k0613, globals.GPT432k0314:
return auth && user.GetQuota(db) >= 50
return user != nil && user.GetQuota(db) >= 50
case globals.SparkDesk:
return auth && user.GetQuota(db) >= 1
return user != nil && user.GetQuota(db) >= 1
case globals.Claude2100k:
return auth && user.GetQuota(db) >= 1
return user != nil && user.GetQuota(db) >= 1
case globals.ZhiPuChatGLMPro, globals.ZhiPuChatGLMStd:
return auth && user.GetQuota(db) >= 1
return user != nil && user.GetQuota(db) >= 1
default:
return true
}
Expand Down

0 comments on commit a71845f

Please sign in to comment.