Sfoglia il codice sorgente

Merge branch 'ctt_dev' into dev

dev
chutingting 1 anno fa
parent
commit
402b7fb583
3 ha cambiato i file con 15 aggiunte e 4 eliminazioni
  1. +1
    -1
      index.html
  2. +4
    -2
      src/router/index.ts
  3. +10
    -1
      src/views/login/index.vue

+ 1
- 1
index.html Vedi File

@@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Metavatar-慧影</title>
<title>Metavatar</title>
</head>

<body>


+ 4
- 2
src/router/index.ts Vedi File

@@ -1,4 +1,4 @@
import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import { createRouter, createWebHashHistory, RouteRecordRaw, useRoute } from "vue-router";
import { getCurrentInstance } from "vue";

export const Layout = () => import("@/layout/index.vue");
@@ -219,7 +219,9 @@ const router = createRouter({
// 2023-5-23 添加平滑滚动 YWQ
scrollBehavior: () => ({ behavior: "smooth", left: 0, top: 0 }),
});

router.beforeEach((to, from) => {
document.title = 'Metavatar-' + (to.query.p || from.query.p || localStorage.getItem("title") || '')
})
/**
* 重置路由
*/


+ 10
- 1
src/views/login/index.vue Vedi File

@@ -19,7 +19,7 @@
>
<div class="flex text-white items-center">
<span class="flex-1 text-center">{{
$t("login.title") + " " + $t("login.login")
title + " " + $t("login.login")
}}</span>
<el-tooltip
class="box-item"
@@ -818,6 +818,15 @@ const currentLan = ref(locale);
const userInfoPinia = userInfoModules();
const route = useRoute();
const router = useRouter();

/**
* 获取页面标题
*/
const title = ref(route.query.p || '')
if (title) {
localStorage.setItem("title", title.value)
document.title = 'Metavatar-' + title.value
}
/**
* 按钮loading
*/


Caricamento…
Annulla
Salva