提交 88d42eda authored 作者: 张烨's avatar 张烨

fix:政令主页-修改网页标题显示异常2

上级 a00f73d3
流水线 #340 已通过 于阶段
in 1 分 39 秒
...@@ -213,8 +213,8 @@ const handleClickMainHeaderBtn = item => { ...@@ -213,8 +213,8 @@ const handleClickMainHeaderBtn = item => {
// 获取全局信息 // 获取全局信息
const summaryInfo = ref({}); const summaryInfo = ref({});
let pageTitle = "科技政令主页"
const handleGetSummary = async () => { const handleGetSummary = async () => {
let pageTitle = "科技政令主页"
try { try {
const res = await getDecreeSummary({ id: route.query.id }); const res = await getDecreeSummary({ id: route.query.id });
console.log("全局信息", res); console.log("全局信息", res);
...@@ -227,6 +227,13 @@ const handleGetSummary = async () => { ...@@ -227,6 +227,13 @@ const handleGetSummary = async () => {
window.sessionStorage.setItem("curTabName", pageTitle); window.sessionStorage.setItem("curTabName", pageTitle);
}; };
// 路由守卫 - 设置页面标题
router.beforeEach((to, from, next) => {
document.title = pageTitle;
window.sessionStorage.setItem("curTabName", pageTitle);
next();
});
// 获取报告原文 // 获取报告原文
// const reportUrl = ref(""); // const reportUrl = ref("");
// const reportUrlEn = ref(""); // const reportUrlEn = ref("");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论