|
|
@@ -179,8 +179,8 @@ public class AiGateway {
|
|
|
Map<String, Object> inputs) {
|
|
|
if (!enabled || isCircuitOpen()) return null;
|
|
|
|
|
|
- // BASIC 配额检查(仅 BASIC 用户)
|
|
|
- if (userId != null) {
|
|
|
+ // BASIC 配额检查(仅对真实用户生效;userId=0 为系统级后台任务,如文章自动分类/打标,不受配额限制)
|
|
|
+ if (userId != null && userId != 0L) {
|
|
|
com.etotem.cfc.dto.QuotaConsumeResult quotaResult = basicQuotaService.consumeQuota(userId, "AI_CHAT");
|
|
|
if (!quotaResult.isSuccess()) {
|
|
|
log.info("AI对话配额不足: userId={}, toast={}", userId, quotaResult.getToastMsg());
|