forked from natuka/web.puabadge.com
修改:logo和名称改为萌趣小宝
This commit is contained in:
1 parent
290b065310
commit
6bf542bf1d
6 files changed
+31
-14
No files matched your search
+20
-3
@@ -10,8 +10,22 @@ import * as douyinRouter from './douyin'
|
||||
import cartoon from '@/views/cartoon/index.vue'
|
||||
import {useStore} from '@/stores'
|
||||
import { config } from '@/config/config'
|
||||
import { douyinConfig } from '@/config/douyin'
|
||||
import { localStorage } from '@/utils/local-storage'
|
||||
|
||||
const DEFAULT_FAVICON = '/douyin-logo.png'
|
||||
|
||||
function setFavicon(href: string) {
|
||||
let link = document.querySelector<HTMLLinkElement>('link[rel="icon"]')
|
||||
if (!link) {
|
||||
link = document.createElement('link')
|
||||
link.rel = 'icon'
|
||||
document.head.appendChild(link)
|
||||
}
|
||||
link.type = 'image/png'
|
||||
link.href = href
|
||||
}
|
||||
|
||||
NProgress.configure({ showSpinner: true, parent: '#app' })
|
||||
|
||||
// 定义路由,每个路由都需要映射到一个组件
|
||||
@@ -74,9 +88,12 @@ router.beforeEach((_to, _from, next) => {
|
||||
const pageTitle = (_to.meta.title as string) || '相册'
|
||||
const titleText = pageTitle.$t || pageTitle
|
||||
const brandText = config.brand?.$t || config.brand || ''
|
||||
// 暂时去掉「葡哇立体肖像」前缀,仅保留页面标题(如「抖音定制」)
|
||||
window.document.title =
|
||||
config.showBrandInTitle && brandText ? `${brandText} - ${titleText}` : String(titleText)
|
||||
const isDouyin = _to.meta.channel === 'douyin' || _to.path.includes('douyin')
|
||||
// 暂时去掉「葡哇立体肖像」前缀;抖音页使用「萌趣小宝.ai定制」
|
||||
window.document.title = isDouyin
|
||||
? `${douyinConfig.brandName} - ${titleText}`
|
||||
: (config.showBrandInTitle && brandText ? `${brandText} - ${titleText}` : String(titleText))
|
||||
setFavicon(isDouyin ? douyinConfig.images.logo : DEFAULT_FAVICON)
|
||||
NProgress.start() // start progress bar
|
||||
const needGuard = _to.meta.needGuard
|
||||
if (needGuard) {
|
||||
|
||||
Reference in new issue
Block a user