{
"summary": "已在底部新增pre标签,显示完整的SEO分析报告JSON对象,包含所

By admin, 1 September, 2025
角色
assistant
content

{
"summary": "已在底部新增pre标签,显示完整的SEO分析报告JSON对象,包含所有分析数据和优化建议。",
"widget": {
"type": "custom-template",
"isAPI": false,
"fullWidth": false,
"html": "<div class=\"container mx-auto px-4 py-8\">\n <div class=\"bg-white rounded-xl shadow-lg p-6 border border-gray-100\">\n <div class=\"flex items-center justify-between mb-6\">\n <h3 class=\"text-xl font-semibold text-gray-800\">SEO 优化建议</h3>\n <div class=\"flex items-center text-sm text-blue-600 bg-blue-50 px-3 py-1 rounded-full\">\n <svg class=\"w-4 h-4 mr-1\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z\" clip-rule=\"evenodd\"></path>\n </svg>\n AI 智能分析\n </div>\n </div>\n \n <div class=\"grid grid-cols-1 lg:grid-cols-3 gap-6\">\n <!-- 左侧:标题和URL分析 -->\n <div class=\"lg:col-span-1 p-5 bg-white rounded-lg border border-gray-200\">\n <h4 class=\"text-lg font-medium text-gray-800 mb-4\">标题与URL分析</h4>\n \n <div class=\"mb-5\">\n <h5 class=\"font-medium text-gray-700 mb-2\">当前标题</h5>\n <p id=\"currentTitle\" class=\"text-gray-600 bg-gray-50 p-3 rounded border border-gray-200\">关于我们</p>\n \n <h5 class=\"font-medium text-green-700 mt-4 mb-2\">优化建议标题</h5>\n <p id=\"optimizedTitle\" class=\"text-green-800 bg-green-50 p-3 rounded border border-green-200\">专家推荐的关于我们 - 公司介绍与品牌故事</p>\n </div>\n \n <div class=\"mb-5\">\n <h5 class=\"font-medium text-gray-700 mb-2\">当前URL</h5>\n <p id=\"currentUrl\" class=\"text-gray-600 bg-gray-50 p-3 rounded border border-gray-200 truncate\">/node/1</p>\n \n <h5 class=\"font-medium text-green-700 mt-4 mb-2\">优化建议URL</h5>\n <p id=\"optimizedUrl\" class=\"text-green-800 bg-green-50 p-3 rounded border border-green-200 truncate\">/about-us</p>\n </div>\n \n <div class=\"mt-4\">\n <h5 class=\"font-medium text-gray-700 mb-2\">元描述分析</h5>\n <p id=\"metaDescription\" class=\"text-gray-600 bg-gray-50 p-3 rounded border border-gray-200\">欢迎了解我们的公司,我们致力于为客户提供优质服务,拥有多年行业经验和专业团队。</p>\n </div>\n </div>\n \n <!-- 中间:内容分析 -->\n <div class=\"lg:col-span-1 p-5 bg-white rounded-lg border border-gray-200\">\n <h4 class=\"text-lg font-medium text-gray-800 mb-4\">内容分析</h4>\n \n <div class=\"grid grid-cols-2 gap-4 mb-5\">\n <div class=\"bg-blue-50 p-3 rounded-lg border border-blue-100\">\n <p class=\"text-sm text-blue-700\">关键词密度</p>\n <p id=\"keywordDensity\" class=\"text-xl font-semibold text-blue-800\">2.3%</p>\n <div class=\"w-full bg-gray-200 rounded-full h-2 mt-2\">\n <div id=\"densityBar\" class=\"bg-blue-600 h-2 rounded-full\" style=\"width: 23%\"></div>\n </div>\n </div>\n \n <div class=\"bg-purple-50 p-3 rounded-lg border border-purple-100\">\n <p class=\"text-sm text-purple-700\">内容长度</p>\n <p id=\"contentLength\" class=\"text-xl font-semibold text-purple-800\">856 词</p>\n </div>\n \n <div class=\"bg-green-50 p-3 rounded-lg border border-green-100\">\n <p class=\"text-sm text-green-700\">可读性评分</p>\n <p id=\"readabilityScore\" class=\"text-xl font-semibold text-green-800\">78/100</p>\n <div class=\"w-full bg-gray-200 rounded-full h-2 mt-2\">\n <div id=\"readabilityBar\" class=\"bg-green-600 h-2 rounded-full\" style=\"width: 78%\"></div>\n </div>\n </div>\n \n <div class=\"bg-amber-50 p-3 rounded-lg border border-amber-100\">\n <p class=\"text-sm text-amber-700\">标题标签</p>\n <p id=\"headingTags\" class=\"text-xl font-semibold text-amber-800\">5 个</p>\n </div>\n </div>\n \n <div class=\"mb-4\">\n <h5 class=\"font-medium text-gray-700 mb-2\">多关键词分析</h5>\n <div id=\"keywordsList\" class=\"bg-gray-50 p-3 rounded border border-gray-200\">\n <div class=\"flex justify-between items-center mb-2\">\n <span class=\"text-gray-700\">公司</span>\n <span class=\"text-blue-600 font-medium\">23 次</span>\n </div>\n <div class=\"flex justify-between items-center mb-2\">\n <span class=\"text-gray-700\">服务</span>\n <span class=\"text-blue-600 font-medium\">18 次</span>\n </div>\n <div class=\"flex justify-between items-center\">\n <span class=\"text-gray-700\">团队</span>\n <span class=\"text-blue-600 font-medium\">15 次</span>\n </div>\n <div class=\"flex justify-between items-center\">\n <span class=\"text-gray-700\">客户</span>\n <span class=\"text-blue-600 font-medium\">12 次</span>\n </div>\n </div>\n </div>\n \n <div class=\"mb-4\">\n <h5 class=\"font-medium text-gray-700 mb-2\">内容优化建议</h5>\n <ul id=\"contentSuggestions\" class=\"list-disc list-inside text-gray-700 space-y-1 bg-gray-50 p-3 rounded border border-gray-200\">\n <li>关键词密度良好</li>\n <li>内容长度适中</li>\n <li>可读性良好</li>\n <li>标题结构良好</li>\n <li>确保内容包含相关内部链接</li>\n <li>添加更多图片或多媒体内容增强用户体验</li>\n </ul>\n </div>\n </div>\n \n <!-- 右侧:可视化区域 -->\n <div class=\"lg:col-span-1 p-5 bg-white rounded-lg border border-gray-200\">\n <h4 class=\"text-lg font-medium text-gray-800 mb-4\">SEO 评分</h4>\n \n <div class=\"flex items-center justify-center mb-6\">\n <div class=\"relative w-40 h-40\">\n <svg class=\"w-full h-full\" viewBox=\"0 0 36 36\">\n <path class=\"text-gray-200\" d=\"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831\" fill=\"none\" stroke-width=\"2\" stroke=\"currentColor\"/>\n <path id=\"scoreArc\" class=\"text-green-500\" d=\"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831\" fill=\"none\" stroke-width=\"2\" stroke-dasharray=\"82, 100\" stroke=\"currentColor\"/>\n </svg>\n <div class=\"absolute inset-0 flex items-center justify-center\">\n <span id=\"seoScore\" class=\"text-3xl font-bold text-gray-800\">82</span>\n </div>\n </div>\n </div>\n \n <div class=\"space-y-3\">\n <div class=\"flex items-center\">\n <div class=\"w-3 h-3 bg-blue-500 rounded-full mr-2\"></div>\n <span class=\"text-sm text-gray-700\">标题优化</span>\n <span id=\"titleScore\" class=\"ml-auto text-sm font-medium text-gray-800\">85/100</span>\n </div>\n <div class=\"flex items-center\">\n <div class=\"w-3 h-3 bg-green-500 rounded-full mr-2\"></div>\n <span class=\"text-sm text-gray-700\">内容质量</span>\n <span id=\"contentScore\" class=\"ml-auto text-sm font-medium text-gray-800\">80/100</span>\n </div>\n <div class=\"flex items-center\">\n <div class=\"w-3 h-3 bg-purple-500 rounded-full mr-2\"></div>\n <span class=\"text-sm text-gray-700\">技术SEO</span>\n <span id=\"techScore\" class=\"ml-auto text-sm font-medium text-gray-800\">81/100</span>\n </div>\n </div>\n </div>\n </div>\n \n <div class=\"flex gap-3 mt-6\">\n <button class=\"bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-lg text-sm transition-colors duration-200\">应用所有建议</button>\n <button class=\"bg-gray-200 hover:bg-gray-300 text-gray-700 py-2 px-4 rounded-lg text-sm transition-colors duration-200\">仅应用内容建议</button>\n <button class=\"bg-gray-200 hover:bg-gray-300 text-gray-700 py-2 px-4 rounded-lg text-sm transition-colors duration-200\" onclick=\"analyzeSeo()\">刷新分析</button>\n </div>\n\n <!-- SEO分析报告JSON -->\n <div class=\"mt-8\">\n <h4 class=\"text-lg font-medium text-gray-800 mb-3\">SEO分析报告</h4>\n <pre id=\"seoReportJson\" class=\"bg-gray-50 p-4 rounded-lg border border-gray-200 text-sm text-gray-700 overflow-auto max-h-80\">\n{\n \"seoAnalysisReport\": {\n \"metadata\": {\n \"analysisDate\": \"2024-01-15T10:30:00Z\",\n \"pageUrl\": \"/node/1\",\n \"pageTitle\": \"关于我们\",\n \"analysisEngine\": \"AI-SEO-Analyzer-v2.0\"\n },\n \"titleAnalysis\": {\n \"currentTitle\": \"关于我们\",\n \"optimizedTitle\": \"专家推荐的关于我们 - 公司介绍与品牌故事\",\n \"titleLength\": 4,\n \"recommendedLength\": \"50-60字符\",\n \"score\": 85,\n \"suggestions\": [\n \"增加品牌标识词\",\n \"包含主要关键词\",\n \"添加价值主张\"\n ]\n },\n \"urlAnalysis\": {\n \"currentUrl\": \"/node/1\",\n \"optimizedUrl\": \"/about-us\",\n \"urlLength\": 7,\n \"containsKeywords\": false,\n \"readability\": \"差\",\n \"score\": 75,\n \"suggestions\": [\n \"使用英文单词提高国际化\",\n \"包含主要关键词\",\n \"避免使用数字ID\"\n ]\n },\n \"contentAnalysis\": {\n \"wordCount\": 856,\n \"recommendedWordCount\": \"800-2000词\",\n \"readabilityScore\": 78,\n \"headingTagsCount\": 5,\n \"paragraphCount\": 12,\n \"keywordDensity\": 2.3,\n \"optimalDensity\": \"1-3%\",\n \"topKeywords\": [\n {\"keyword\": \"公司\", \"count\": 23, \"density\": 2.7},\n {\"keyword\": \"服务\", \"count\": 18, \"density\": 2.1},\n {\"keyword\": \"团队\", \"count\": 15, \"density\": 1.8},\n {\"keyword\": \"客户\", \"count\": 12, \"density\": 1.4}\n ],\n \"score\": 80,\n \"suggestions\": [\n \"关键词密度良好\",\n \"内容长度适中\",\n \"可读性良好\",\n \"标题结构良好\",\n \"确保内容包含相关内部链接\",\n \"添加更多图片或多媒体内容增强用户体验\"\n ]\n },\n \"metaDescriptionAnalysis\": {\n \"currentDescription\": \"欢迎了解我们的公司,我们致力于为客户提供优质服务,拥有多年行业经验和专业团队。\",\n \"descriptionLength\": 42,\n \"recommendedLength\": \"120-155字符\",\n \"containsKeywords\": true,\n \"score\": 78,\n \"suggestions\": [\n \"长度适中但可优化\",\n \"包含主要关键词\",\n \"添加行动号召语句\"\n ]\n },\n \"technicalSeo\": {\n \"headingStructure\": \"良好\",\n \"internalLinks\": 8,\n \"externalLinks\": 3,\n \"imageAltTags\": \"部分缺失\",\n \"mobileResponsive\": true,\n \"loadingSpeed\": \"2.8s\",\n \"score\": 81,\n \"suggestions\": [\n \"为所有图片添加alt标签\",\n \"优化页面加载速度\",\n \"增加内部链接数量\"\n ]\n },\n \"overallScore\": {\n \"total\": 82,\n \"rating\": \"良好\",\n \"breakdown\": {\n \"title\": 85,\n \"content\": 80,\n \"technical\": 81,\n \"url\": 75,\n \"meta\": 78\n },\n \"recommendations\": [\n \"优化URL结构\",\n \"完善元描述\",\n \"增加图片alt标签\",\n \"优化页面加载速度\"\n ]\n }\n }\n}\n </pre>\n </div>\n </div>\n</div>\n\n<script>\n// 页面加载完成后自动执行分析\ndocument.addEventListener('DOMContentLoaded', function() {\n analyzeSeo();\n});\n\n// SEO分析函数\nfunction analyzeSeo() {\n // 使用假设数据填充\n const currentTitle = \"关于我们\";\n const currentUrl = \"/node/1\";\n \n // 填充当前信息\n document.getElementById('currentTitle').textContent = currentTitle;\n document.getElementById('currentUrl').textContent = currentUrl;\n \n // 生成优化建议\n document.getElementById('optimizedTitle').textContent = \"专家推荐的关于我们 - 公司介绍与品牌故事\";\n document.getElementById('optimizedUrl').textContent = \"/about-us\";\n \n // 元描述分析\n document.getElementById('metaDescription').textContent = \"欢迎了解我们的公司,我们致力于为客户提供优质服务,拥有多年行业经验和专业团队。\";\n \n // 内容分析结果\n analyzeContent();\n}\n\n// 内容分析函数\nfunction analyzeContent() {\n // 使用假设数据\n document.getElementById('keywordDensity').textContent = \"2.3%\";\n document.getElementById('densityBar').style.width = \"23%\";\n document.getElementById('contentLength').textContent = \"856 词\";\n document.getElementById('readabilityScore').textContent = \"78/100\";\n document.getElementById('readabilityBar').style.width = \"78%\";\n document.getElementById('headingTags').textContent = \"5 个\";\n \n // 多关键词分析\n const keywordsHtml = `\n <div class=\"flex justify-between items-center mb-2\">\n <span class=\"text-gray-700\">公司</span>\n <span class=\"text-blue-600 font-medium\">23 次</span>\n </div>\n <div class=\"flex justify-between items-center mb-2\">\n <span class=\"text-gray-700\">服务</span>\n <span class=\"text-blue-600 font-medium\">18 次</span>\n </div>\n <div class=\"flex justify-between items-center\">\n <span class=\"text-gray-700\">团队</span>\n <span class=\"text-blue-600 font-medium\">15 次</span>\n </div>\n <div class=\"flex justify-between items-center\">\n <span class=\"text-gray-700\">客户</span>\n <span class=\"text-blue-600 font-medium\">12 次</span>\n </div>\n `;\n document.getElementById('keywordsList').innerHTML = keywordsHtml;\n \n // 生成内容建议\n const suggestions = [\n '关键词密度良好',\n '内容长度适中',\n '可读性良好',\n '标题结构良好',\n '确保内容包含相关内部链接',\n '添加更多图片或多媒体内容增强用户体验'\n ];\n \n const suggestionsList = document.getElementById('contentSuggestions');\n suggestionsList.innerHTML = '';\n suggestions.forEach(suggestion => {\n const li = document.createElement('li');\n li.textContent = suggestion;\n suggestionsList.appendChild(li);\n });\n \n // 更新SEO评分\n updateSeoScore();\n}\n\n// 更新SEO评分\nfunction updateSeoScore() {\n // 使用假设评分数据\n const totalScore = 82;\n \n // 更新评分显示\n document.getElementById('seoScore').textContent = totalScore;\n document.getElementById('titleScore').textContent = \"85/100\";\n document.getElementById('contentScore').textContent = \"80/100\";\n document.getElementById('techScore').textContent = \"81/100\";\n \n // 更新评分圆弧\n const arc = document.getElementById('scoreArc');\n const dasharray = `${totalScore}, 100`;\n arc.setAttribute('stroke-dasharray', dasharray);\n \n // 根据评分调整颜色\n if (totalScore >= 80) {\n arc.classList.remove('text-green-500', 'text-yellow-500', 'text-red-500');\n arc.classList.add('text-green-500');\n } else if (totalScore >= 60) {\n arc.classList.remove('text-green-500', 'text-yellow-500', 'text-red-500');\n arc.classList.add('text-yellow-500');\n } else {\n arc.classList.remove('text-green-500', 'text-yellow-500', 'text-red-500');\n arc.classList.add('text-red-500');\n }\n}\n</script>"
},
"next": ["添加JSON导出功能", "增加报告分享选项", "添加历史报告对比", "集成真实API数据", "优化JSON显示样式"]
}

total_tokens
25359