forked from natuka/web.puabadge.com
修改:新增抖音下单页面
This commit is contained in:
1 parent
024c8a5155
commit
73971e4a08
38 files changed
+14447
-35505
No files matched your search
@@ -0,0 +1,64 @@
|
||||
import 'nprogress/nprogress.css'
|
||||
|
||||
import douyinHome from '@/views/douyin/index.vue'
|
||||
import douyinGenerating from '@/views/douyin/generating.vue'
|
||||
import douyinPreview from '@/views/douyin/preview.vue'
|
||||
import douyinRecords from '@/views/douyin/records.vue'
|
||||
import douyinSuccess from '@/views/douyin/success.vue'
|
||||
|
||||
export const routes = [
|
||||
{
|
||||
path: '/douyin',
|
||||
name: 'douyin',
|
||||
component: douyinHome,
|
||||
meta: {
|
||||
needGuard: true,
|
||||
title: '抖音定制',
|
||||
channel: 'douyin',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/douyin/generating',
|
||||
name: 'douyinGenerating',
|
||||
component: douyinGenerating,
|
||||
meta: {
|
||||
needGuard: true,
|
||||
title: '生成中',
|
||||
channel: 'douyin',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/douyin/preview',
|
||||
name: 'douyinPreview',
|
||||
component: douyinPreview,
|
||||
meta: {
|
||||
needGuard: true,
|
||||
title: '效果预览',
|
||||
channel: 'douyin',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/douyin/records',
|
||||
name: 'douyinRecords',
|
||||
component: douyinRecords,
|
||||
meta: {
|
||||
needGuard: true,
|
||||
title: '生成记录',
|
||||
channel: 'douyin',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/douyin/success',
|
||||
name: 'douyinSuccess',
|
||||
component: douyinSuccess,
|
||||
meta: {
|
||||
needGuard: true,
|
||||
title: '提交成功',
|
||||
channel: 'douyin',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export function mergeRoutes(allRoutes: any[]) {
|
||||
allRoutes.push(...routes)
|
||||
}
|
||||
+5
-4
@@ -5,6 +5,7 @@ import 'nprogress/nprogress.css'
|
||||
// 导入路由组件
|
||||
// import * as badgeRouter from './badge'
|
||||
import * as cartoonRouter from './cartoon'
|
||||
import * as douyinRouter from './douyin'
|
||||
// import badge from '@/views/badge/index.vue'
|
||||
import cartoon from '@/views/cartoon/index.vue'
|
||||
import {useStore} from '@/stores'
|
||||
@@ -28,6 +29,7 @@ const routes = [
|
||||
|
||||
// badgeRouter.mergeRoutes(routes)
|
||||
cartoonRouter.mergeRoutes(routes)
|
||||
douyinRouter.mergeRoutes(routes)
|
||||
// 创建路由实例并传递 `routes` 配置
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(process.env.VUE_APP_PUBLIC_PATH),
|
||||
@@ -56,7 +58,7 @@ router.beforeEach((_to, _from, next) => {
|
||||
if (code) {
|
||||
let url = store.redirectUrl()
|
||||
|
||||
if (_to.path !== '/cartoon') {
|
||||
if (_to.path !== '/cartoon' && !_to.path.includes('douyin')) {
|
||||
if (url) {
|
||||
store.setRedirect('')
|
||||
next(url)
|
||||
@@ -69,9 +71,8 @@ router.beforeEach((_to, _from, next) => {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 根据API获取用信息
|
||||
window.document.title = `${config.brand.$t} - ${(_to.meta.title as string || '相册').$t}`
|
||||
// store.updateTitle(_to.meta.title.$t); // 导航栏标题变化
|
||||
const pageTitle = (_to.meta.title as string) || '相册'
|
||||
window.document.title = `${config.brand.$t} - ${pageTitle.$t || pageTitle}`
|
||||
NProgress.start() // start progress bar
|
||||
const needGuard = _to.meta.needGuard
|
||||
if (needGuard) {
|
||||
|
||||
Reference in new issue
Block a user