💄 Better title
This commit is contained in:
parent
37a68eac28
commit
f3473aeb83
@ -14,9 +14,24 @@ const router = createRouter({
|
||||
path: "/",
|
||||
component: UserCenterLayout,
|
||||
children: [
|
||||
{ path: "/", name: "dashboard", component: () => import("@/views/dashboard.vue") },
|
||||
{ path: "/me/personalize", name: "personalize", component: () => import("@/views/personalize.vue") },
|
||||
{ path: "/me/security", name: "security", component: () => import("@/views/security.vue") },
|
||||
{
|
||||
path: "/",
|
||||
name: "dashboard",
|
||||
component: () => import("@/views/dashboard.vue"),
|
||||
meta: { title: "Your account" },
|
||||
},
|
||||
{
|
||||
path: "/me/personalize",
|
||||
name: "personalize",
|
||||
component: () => import("@/views/personalize.vue"),
|
||||
meta: { title: "Your personality" },
|
||||
},
|
||||
{
|
||||
path: "/me/security",
|
||||
name: "security",
|
||||
component: () => import("@/views/security.vue"),
|
||||
meta: { title: "Your security" },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
@ -28,13 +43,13 @@ const router = createRouter({
|
||||
path: "sign-in",
|
||||
name: "auth.sign-in",
|
||||
component: () => import("@/views/auth/sign-in.vue"),
|
||||
meta: { public: true },
|
||||
meta: { public: true, title: "Sign in" },
|
||||
},
|
||||
{
|
||||
path: "sign-up",
|
||||
name: "auth.sign-up",
|
||||
component: () => import("@/views/auth/sign-up.vue"),
|
||||
meta: { public: true },
|
||||
meta: { public: true, title: "Sign up" },
|
||||
},
|
||||
{
|
||||
path: "o/connect",
|
||||
@ -52,6 +67,12 @@ router.beforeEach(async (to, from, next) => {
|
||||
await id.readProfiles()
|
||||
}
|
||||
|
||||
if (to.meta.title) {
|
||||
document.title = `Solarpass | ${to.meta.title}`
|
||||
} else {
|
||||
document.title = "Solarpass"
|
||||
}
|
||||
|
||||
if (!to.meta.public && !id.userinfo.isLoggedIn) {
|
||||
next({ name: "auth.sign-in", query: { redirect_uri: to.fullPath } })
|
||||
} else {
|
||||
|
@ -120,6 +120,7 @@ async function preconnect() {
|
||||
panel.value = "callback"
|
||||
callback(data["session"])
|
||||
} else {
|
||||
document.title = `Solarpass | Connect to ${data["client"]?.name}`
|
||||
metadata.value = data["client"]
|
||||
loading.value = false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user