Files
qnc-webview-v3/src/composables/useSEO.js
2026-02-28 14:33:47 +08:00

267 lines
13 KiB
JavaScript

import { ref, watch } from "vue";
import { useRoute } from "vue-router";
export function useSEO() {
const route = useRoute();
// 默认SEO信息
const defaultSEO = {
title: "全能查官网_个人婚姻状态报告_综合风险排查工具箱",
description:
"全能查是您的掌上风控工具箱。平台基于合规数据,提供个人婚姻状态分析、职场背调及黑名单筛查服务。无需繁琐流程,客观中立,一键生成包含婚姻涉诉历史与家庭风险的综合报告,助您快速识别潜在隐患。",
keywords:
"全能查,婚姻状态核实,风险排查工具,个人风险预警,第三方背调,商业信用评估",
url: "https://www.quannengcha.com",
};
// 页面SEO配置
const pageSEO = ref({
title: "",
description: "",
keywords: "",
url: "",
});
// 更新页面SEO信息
const updateSEO = (seoConfig) => {
const config = { ...defaultSEO, ...seoConfig };
// 更新页面标题
document.title = config.title;
// 更新meta描述
let metaDescription = document.querySelector(
'meta[name="description"]'
);
if (!metaDescription) {
metaDescription = document.createElement("meta");
metaDescription.name = "description";
document.head.appendChild(metaDescription);
}
metaDescription.content = config.description;
// 更新meta关键词
let metaKeywords = document.querySelector('meta[name="keywords"]');
if (!metaKeywords) {
metaKeywords = document.createElement("meta");
metaKeywords.name = "keywords";
document.head.appendChild(metaKeywords);
}
metaKeywords.content = config.keywords;
// 更新Open Graph标签
updateOpenGraph(config);
// 更新Twitter Cards
updateTwitterCards(config);
// 更新canonical URL
updateCanonicalURL(config.url);
// 更新结构化数据
updateStructuredData(config);
};
// 更新Open Graph标签
const updateOpenGraph = (config) => {
const ogTags = {
"og:title": config.title,
"og:description": config.description,
"og:url": config.url,
"og:type": "website",
"og:site_name": "全能查",
"og:locale": "zh_CN",
};
Object.entries(ogTags).forEach(([property, content]) => {
let meta = document.querySelector(`meta[property="${property}"]`);
if (!meta) {
meta = document.createElement("meta");
meta.setAttribute("property", property);
document.head.appendChild(meta);
}
meta.content = content;
});
};
// 更新Twitter Cards
const updateTwitterCards = (config) => {
const twitterTags = {
"twitter:card": "summary",
"twitter:title": config.title,
"twitter:description": config.description,
"twitter:url": config.url,
};
Object.entries(twitterTags).forEach(([name, content]) => {
let meta = document.querySelector(`meta[name="${name}"]`);
if (!meta) {
meta = document.createElement("meta");
meta.name = name;
document.head.appendChild(meta);
}
meta.content = content;
});
};
// 更新canonical URL
const updateCanonicalURL = (url) => {
let canonical = document.querySelector('link[rel="canonical"]');
if (!canonical) {
canonical = document.createElement("link");
canonical.rel = "canonical";
document.head.appendChild(canonical);
}
canonical.href = url;
};
// 更新结构化数据
const updateStructuredData = (config) => {
// 移除现有的结构化数据
const existingScripts = document.querySelectorAll(
'script[type="application/ld+json"]'
);
existingScripts.forEach((script) => {
if (script.textContent.includes('"@type":"WebPage"')) {
script.remove();
}
});
// 添加新的结构化数据
const structuredData = {
"@context": "https://schema.org",
"@type": "WebPage",
name: config.title,
description: config.description,
url: config.url,
mainEntity: {
"@type": "Organization",
name: "全能查",
url: "https://www.quannengcha.com/",
description:
"专业大数据风险报告查询与代理平台,支持个人和企业多场景风控应用",
},
};
const script = document.createElement("script");
script.type = "application/ld+json";
script.textContent = JSON.stringify(structuredData);
document.head.appendChild(script);
};
// 根据路由自动更新SEO
const updateSEOByRoute = () => {
const routeConfigs = {
"/": {
title: "全能查官网_个人婚姻状态报告_综合风险排查工具箱",
description:
"全能查是您的掌上风控工具箱。平台基于合规数据,提供个人婚姻状态分析、职场背调及黑名单筛查服务。无需繁琐流程,客观中立,一键生成包含婚姻涉诉历史与家庭风险的综合报告,助您快速识别潜在隐患。",
keywords:
"全能查,婚姻状态核实,风险排查工具,个人风险预警,第三方背调,商业信用评估",
},
"/agent/system-guide": {
title: "全能查合作政策指南_合作伙伴权益与结算说明_官方文档",
description:
"全能查官方合作体系说明文档。详细解读合作伙伴的等级权益、服务费结算标准及晋升机制。致力于构建公平、透明的商业合作生态,助力合作伙伴快速上手业务。",
keywords: "合作伙伴政策,服务费结算,渠道等级说明,业务操作指南,代理系统后台",
},
// 个人查询
'/inquire/riskassessment': {
title: '个人综合风险分析_履约能力画像_多维数据检测_全能查',
description: '全能查个人风险报告为您提供全方位的信用健康度参考。基于公开数据深度解析综合风险指数、司法关联风险、历史履约趋势及潜在的负面标签。数据客观中立,帮助用户建立良好的个人履约记录管理意识。',
keywords: '个人风险检测,履约能力分析,综合风险指数,信用健康度,个人数据画像'
},
// 企业查询
'/inquire/companyinfo': {
title: '企业工商信用画像_经营异常与商业风险透视_全能查',
description: '全能查企业版深度透视商业真相。聚合工商、司法及税务公开数据,核验企业经营异常名录、行政处罚、法律诉讼及股权穿透信息。全方位评估合作伙伴的商业健康度,规避合同违约风险。',
keywords: '企业信用评估,工商背景核验,商业风险评估,公司经营异常,合作方背景核实'
},
// 贷前风险
'/inquire/preloanbackgroundcheck': {
title: '综合履约评分检测_多平台履约记录分析_个人财务履约报告_天远助手',
description: '天远助手提供专业的个人履约健康度体检服务。基于多维大数据分析,检测您的综合评分波动、历史履约记录及潜在的风险标签。本服务旨在帮助用户优化个人数据画像,提升信用管理意识,不提供任何信贷金融服务。',
keywords: '综合评分检测,多重履约压力分析,履约能力评估,综合评分优化,个人数据画像'
},
// 婚恋风险
'/inquire/marriage': {
title: '婚前综合背景了解_情感安全风险评估_家庭履约分析_全能查',
description: '全能查婚恋风险报告基于合法公开数据,辅助评估对象的婚前背景。核心核验司法涉诉记录、失信被执行历史、多重履约能力及不良社会标签。拒绝情感盲区,用数据守护您的家庭与财产安全。',
keywords: '婚前背景报告,恋爱对象风险,情感安全评估,司法记录核验,家庭风险防范'
},
// 入职背调
'/inquire/backgroundcheck': {
title: '职场背景核验报告_候选人职业风险与竞业核验_全能查',
description: '全能查为企业提供专业的入职背调服务。一键筛查候选人的学历背景、涉及的商业利益冲突、劳动仲裁记录及社会不良风险。数据实时合规,降低企业用工试错成本,提升招聘决策效率。',
keywords: '员工入职背调,职业背景核实,竞业限制评估,职场信用报告,候选人风险筛查'
},
// 家政风险
'/inquire/homeservice': {
title: '家政人员背景核实_保姆月嫂司法安全评估_全能查',
description: '全能查针对家庭用工场景,提供客观的家政人员背景核验服务。重点核验身份信息、司法涉诉记录及失信历史。辅助雇主识别高危人员,让居家养老育儿更安心。',
keywords: '保姆背景核验,家政风险筛查,月嫂司法记录,雇佣安全评估,家政人员核验'
},
'/inquire/consumerFinanceReport': {
title: '个人履约能力评估_经济风险与收支压力参考_全能查',
description: '全能查履约报告基于大数据算法,提供个人经济稳定性的客观分析。多维度检测综合履约分、经济关联风险及潜在的资金压力指数。本服务仅提供大数据层面的风险参考,助您优化财务管理。',
keywords: '履约能力评估,经济风险指数,综合评分波动,资金压力分析,财务健康度'
},
"/agent": {
title: "全能查代理 - 免费开通代理权限 | 大数据风险报告代理",
description:
"全能查代理平台,免费开通代理权限,享受大数据风险报告查询服务代理收益。专业的大数据风险报告、婚姻查询、个人信用评估等服务的代理合作。",
keywords:
"全能查代理, 免费代理, 大数据风险报告代理, 代理权限, 代理收益",
},
"/help": {
title: "帮助中心 - 全能查使用指南 | 常见问题解答",
description:
"全能查帮助中心,提供详细的使用指南、常见问题解答、操作教程等,帮助用户更好地使用大数据风险报告查询服务。",
keywords: "全能查帮助, 使用指南, 常见问题, 操作教程, 客服支持",
},
"/help/guide": {
title: "使用指南 - 全能查操作教程 | 功能说明",
description:
"全能查详细使用指南,包含各功能模块的操作教程、功能说明、注意事项等,让用户快速上手使用。",
keywords: "使用指南, 操作教程, 功能说明, 快速上手, 全能查教程",
},
"/example": {
title: "示例报告 - 全能查报告展示 | 大数据风险报告样例",
description:
"全能查示例报告展示,包含大数据风险报告、婚姻状况查询、个人信用评估等服务的报告样例,让用户了解报告内容和格式。",
keywords:
"示例报告, 报告展示, 报告样例, 大数据风险报告, 婚姻查询报告",
},
"/service": {
title: "客服中心 - 全能查在线客服 | 技术支持",
description:
"全能查客服中心,提供在线客服支持、技术咨询、问题反馈等服务,确保用户获得及时有效的帮助。",
keywords: "客服中心, 在线客服, 技术支持, 问题反馈, 全能查客服",
},
"/promote": {
title: "全能查合伙人计划_风控平台系统招商_渠道合作平台_全能查",
description:"全能查开放全国渠道合作,提供零门槛的风险评估系统接入服务。一键开通独立后台,支持婚恋、职场、家政及商业风控等多场景报告推广。正规项目,结算透明,赋能流量方实现合规商业价值。",
keywords:"风控系统代理,风险评估平台招商,平台渠道合作,企业服务创业,全能查合伙人",
},
};
const currentPath = route?.path || "/";
const config = routeConfigs[currentPath] || defaultSEO;
updateSEO({
...config,
url: `https://www.quannengcha.com${currentPath}`,
});
};
// 监听路由变化
watch(() => route?.path, updateSEOByRoute, { immediate: true });
return {
updateSEO,
updateSEOByRoute,
pageSEO,
};
}