agent功能开发增加MCP后端

This commit is contained in:
2025-11-07 22:45:46 +08:00
parent e29f391f10
commit d8dc79d32c
2 changed files with 62 additions and 14 deletions

View File

@@ -220,8 +220,8 @@ const AgentChatV3 = () => {
const handleSendMessage = async () => {
if (!inputValue.trim() || isProcessing) return;
// 权限检查 - 检查订阅类型与Community等页面保持一致)
const hasAccess = user?.subscription_type === 'max' || user?.subscription_type === 'pro';
// 权限检查 - 只允许 max 用户访问(与传导链分析权限保持一致)
const hasAccess = user?.subscription_type === 'max';
if (!hasAccess) {
logger.warn('AgentChat', '权限检查失败', {
@@ -233,7 +233,7 @@ const AgentChatV3 = () => {
toast({
title: '订阅升级',
description: '「价小前投研」功能需要 Pro 或 Max 订阅。请前往设置页面升级您的订阅。',
description: '「价小前投研」功能需要 Max 订阅。请前往设置页面升级您的订阅。',
status: 'warning',
duration: 5000,
isClosable: true,
@@ -284,6 +284,7 @@ const AgentChatV3 = () => {
user_id: user?.id ? String(user.id) : 'anonymous',
user_nickname: user?.nickname || user?.username || '匿名用户',
user_avatar: user?.avatar || '',
subscription_type: user?.subscription_type || 'free', // 传递订阅类型
session_id: currentSessionId,
});