@@ -5,7 +5,7 @@ | |||||
<meta charset="UTF-8" /> | <meta charset="UTF-8" /> | ||||
<link rel="icon" href="/favicon.ico" /> | <link rel="icon" href="/favicon.ico" /> | ||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||
<title>Metavatar-慧影</title> | |||||
<title>Metavatar</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -1,4 +1,4 @@ | |||||
import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"; | |||||
import { createRouter, createWebHashHistory, RouteRecordRaw, useRoute } from "vue-router"; | |||||
import { getCurrentInstance } from "vue"; | import { getCurrentInstance } from "vue"; | ||||
export const Layout = () => import("@/layout/index.vue"); | export const Layout = () => import("@/layout/index.vue"); | ||||
@@ -219,7 +219,9 @@ const router = createRouter({ | |||||
// 2023-5-23 添加平滑滚动 YWQ | // 2023-5-23 添加平滑滚动 YWQ | ||||
scrollBehavior: () => ({ behavior: "smooth", left: 0, top: 0 }), | scrollBehavior: () => ({ behavior: "smooth", left: 0, top: 0 }), | ||||
}); | }); | ||||
router.beforeEach((to, from) => { | |||||
document.title = 'Metavatar-' + (to.query.p || from.query.p || localStorage.getItem("title") || '') | |||||
}) | |||||
/** | /** | ||||
* 重置路由 | * 重置路由 | ||||
*/ | */ | ||||
@@ -19,7 +19,7 @@ | |||||
> | > | ||||
<div class="flex text-white items-center"> | <div class="flex text-white items-center"> | ||||
<span class="flex-1 text-center">{{ | <span class="flex-1 text-center">{{ | ||||
$t("login.title") + " " + $t("login.login") | |||||
title + " " + $t("login.login") | |||||
}}</span> | }}</span> | ||||
<el-tooltip | <el-tooltip | ||||
class="box-item" | class="box-item" | ||||
@@ -818,6 +818,15 @@ const currentLan = ref(locale); | |||||
const userInfoPinia = userInfoModules(); | const userInfoPinia = userInfoModules(); | ||||
const route = useRoute(); | const route = useRoute(); | ||||
const router = useRouter(); | const router = useRouter(); | ||||
/** | |||||
* 获取页面标题 | |||||
*/ | |||||
const title = ref(route.query.p || '') | |||||
if (title) { | |||||
localStorage.setItem("title", title.value) | |||||
document.title = 'Metavatar-' + title.value | |||||
} | |||||
/** | /** | ||||
* 按钮loading | * 按钮loading | ||||
*/ | */ | ||||