初始化黄果短剧 H5 客户端
对接后端 hgmjapi.mfcg.me: - 接口解密 key 更新为 resKey360 - 登录 sysType 使用原生 getDevType(后端已放开 pc/android) - 修正榜单接口路径 /vid/rangking → /vid/ranking,方法改为 GET Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,149 @@
|
||||
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
|
||||
import Home from '@/views/home/index.vue';
|
||||
import pcRouter from './pcRouter';
|
||||
import mobileRouter from './mobileRouter';
|
||||
import MobilePrivacyPolicy from '@/views/mobile/privacyPolicy/index.vue';
|
||||
import MobileSearch from '@/views/mobile/mobileSearch/index.vue';
|
||||
import Polymerization from '@/views/polymerization/index.vue';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: Home,
|
||||
redirect: '/home',
|
||||
meta: {
|
||||
title: '首页',
|
||||
},
|
||||
children: [...pcRouter, ...mobileRouter],
|
||||
},
|
||||
{
|
||||
path: '/mobilePrivacyPolicy',
|
||||
name: 'mobilePrivacyPolicy',
|
||||
component: MobilePrivacyPolicy,
|
||||
meta: {
|
||||
title: '隐私政策',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/mobileSearch',
|
||||
name: 'mobileSearch',
|
||||
component: MobileSearch,
|
||||
meta: {
|
||||
title: '搜索',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/mobileConnectInfo',
|
||||
name: 'mobileConnectInfo',
|
||||
component: () => import('@/views/mobile/connectInfo/index.vue'),
|
||||
meta: {
|
||||
title: '联系官方',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/sectionDetails',
|
||||
name: 'sectionDetails',
|
||||
component: () => import('@/views/mobile/sectionDetails/index.vue'),
|
||||
meta: {
|
||||
title: '专题详情',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/videoDetails',
|
||||
name: 'videoDetails',
|
||||
component: () => import('@/views/mobile/videoDetails/index.vue'),
|
||||
meta: {
|
||||
title: '视频详情',
|
||||
},
|
||||
},
|
||||
// {
|
||||
// path: '/mobileClassification',
|
||||
// name: 'mobileClassification',
|
||||
// component: () => import('@/views/mobile/classification/index.vue'),
|
||||
// meta: {
|
||||
// title: '分类列表',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
path: '/releaseAddress',
|
||||
name: 'releaseAddress',
|
||||
component: () => import('@/views/mobile/releaseAddress/index.vue'),
|
||||
meta: {
|
||||
title: '发布地址',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/collect',
|
||||
name: 'collect',
|
||||
component: () => import('@/views/mobile/collect/index.vue'),
|
||||
meta: {
|
||||
title: '我的收藏',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/mobileBusiness',
|
||||
name: 'mobileBusiness',
|
||||
component: () => import('@/views/mobile/mobileBusiness/index.vue'),
|
||||
meta: {
|
||||
title: '商务合作',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/userHomepage',
|
||||
name: 'userHomepage',
|
||||
component: () => import('@/views/mobile/userHomepage/index.vue'),
|
||||
meta: {
|
||||
title: '用户主页',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/userHomepage',
|
||||
name: 'userHomepage',
|
||||
component: () => import('@/views/mobile/userHomepage/index.vue'),
|
||||
meta: {
|
||||
title: '用户主页',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/mobileHistory',
|
||||
name: 'mobileHistory',
|
||||
component: () => import('@/views/mobile/mobileHistory/index.vue'),
|
||||
meta: {
|
||||
title: '历史记录',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/tagDetails',
|
||||
name: 'tagDetails',
|
||||
component: () => import('@/views/mobile/tagDetails/index.vue'),
|
||||
meta: {
|
||||
title: '历史记录',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/polymerization',
|
||||
name: 'polymerization',
|
||||
component: Polymerization,
|
||||
meta: {
|
||||
title: '聚合下载',
|
||||
},
|
||||
},
|
||||
];
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const home = document.querySelector('#home');
|
||||
home && home.scrollTo(0, 0);
|
||||
document.title = '蛋黄派-' + to.meta.title;
|
||||
const token = localStorage.getItem('token');
|
||||
if (token || to.path === '/home' || to.path === '/polymerization') {
|
||||
next();
|
||||
} else {
|
||||
next('/home');
|
||||
}
|
||||
});
|
||||
export default router;
|
||||
Reference in New Issue
Block a user