| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- import VueRouter from 'vue-router'
- import Vue from 'vue'
- // 懒加载引入页面组件,es6语法
- const Home = () => import('views/home/Index')
- const TimelineIndex = () => import('views/home/Timeline')
- const StatusPage = () => import('views/home/Status')
- const VideoIndex = () => import('views/home/Video')
- const VideoPage = () => import('views/home/VideoPage')
- const AudioIndex = () => import('views/home/Audio')
- const AudioPage = () => import('views/home/AudioPage')
- const ImageIndex = () => import('views/home/Image')
- const ImagePage = () => import('views/home/ImagePage')
- const ArticleIndex = () => import('views/home/Article')
- const Search = () => import('views/home/Search')
- const UserHome = () => import('views/user/Home')
- const UserVideo = () => import('views/user/Home')
- const UserImage = () => import('views/user/Home')
- const UserAudio = () => import('views/user/Home')
- const UserArticle = () => import('views/user/Home')
- const UserRelation = () => import('views/user/UserRelation')
- const CollectionIndex = () => import('views/user/Collection')
- const HistoryIndex = () => import('views/user/History')
- const PostPublish = () => import('views/post/PostPublish')
- const PostPublishVideo = () => import('views/post/PostPublish')
- const PostEditVideo = () => import('components/upload/EditVideo')
- const PostPublishAudio = () => import('views/post/PostPublish')
- const PostEditAudio = () => import('components/upload/EditAudio')
- const PostPublishAlbum = () => import('views/post/PostPublish')
- const PostEditAlbum = () => import('components/upload/EditImage')
- const PostPublishArticle = () => import('views/post/PostPublish')
- const PostList = () => import('views/post/PostList')
- const UserPostVideo = () => import('views/post/PostList')
- const UserPostAudio = () => import('views/post/PostList')
- const UserPostImage = () => import('views/post/PostList')
- const UserPostArticle = () => import('views/post/PostList')
- const PostAnalysis = () => import('views/post/PostAnalysis')
- const MessageIndex = () => import('views/message/Message')
- const DiscoverIndex = () => import('views/home/Discover')
- // 使用安装路由插件
- Vue.use(VueRouter)
- const routes = [
- {
- path: '/sso',
- name: 'sso',
- redirect: '/sso/login',
- component: () => import('@/views/sso/layout'),
- children: [
- {
- path: '/sso/login',
- meta: {
- title: '验证码登录',
- needLogin: false,
- },
- component: () => import('@/views/sso/login'),
- },
- {
- path: '/sso/login1',
- meta: {
- title: '密码登录',
- needLogin: false,
- },
- component: () => import('@/views/sso/login1'),
- },
- {
- path: '/sso/register',
- meta: {
- title: '账号注册?',
- needLogin: false,
- },
- component: () => import('@/views/sso/register'),
- },
- {
- path: '/sso/forget',
- meta: {
- title: '找回密码?',
- needLogin: false,
- },
- component: () => import('@/views/sso/forget'),
- },
- ],
- },
- {
- path: '/',
- name: 'index',
- component: Home
- },
- {
- path: '/status',
- name: 'TimelineIndex',
- component: TimelineIndex
- },
- {
- path: '/status/:statusId',
- name: 'StatusPage',
- component: StatusPage
- },
- {
- path: '/video',
- name: 'VideoIndex',
- component: VideoIndex
- },
- {
- path: '/video/:id',
- name: 'VideoPage',
- component: VideoPage
- },
- {
- path: '/audio',
- name: 'AudioIndex',
- component: AudioIndex
- },
- {
- path: '/audio/:audioId',
- name: 'AudioPage',
- component: AudioPage
- },
- {
- path: '/image',
- name: 'ImageIndex',
- component: ImageIndex
- },
- {
- path: '/image/:id',
- name: 'ImagePage',
- component: ImagePage
- },
- {
- path: '/image/album/:albumId',
- name: 'ImagePage',
- component: ImagePage
- },
- {
- path: '/article',
- name: 'ArticleIndex',
- component: ArticleIndex
- },
- {
- path: '/discover',
- name: 'DiscoverIndex',
- component: DiscoverIndex
- },
- {
- path: '/search',
- name: 'search',
- component: Search
- },
- {
- path: '/user/:id',
- name: 'UserHome',
- component: UserHome
- },
- {
- path: '/user/:id/video',
- name: 'UserVideo',
- component: UserVideo
- },
- {
- path: '/user/:id/image',
- name: 'UserImage',
- component: UserImage
- },
- {
- path: '/user/:id/audio',
- name: 'UserAudio',
- component: UserAudio
- },
- {
- path: '/user/:id/article',
- name: 'UserArticle',
- component: UserArticle
- },
- {
- path: '/user/:id/following',
- name: 'UserRelation',
- component: UserRelation
- },
- {
- path: '/user/:id/follower',
- name: 'UserRelation',
- component: UserRelation
- },
- {
- path: '/u/collection',
- name: 'CollectionIndex',
- component: CollectionIndex
- },
- {
- path: '/u/history',
- name: 'HistoryIndex',
- component: HistoryIndex
- },
- {
- path: '/post/publish',
- name: 'PostPublish',
- component: PostPublish
- },
- {
- path: '/post/publish/video',
- name: 'PostPublishVideo',
- component: PostPublishVideo
- },
- {
- path: '/post/edit/video/:videoId',
- name: 'PostEditVideo',
- component: PostEditVideo
- },
- {
- path: '/post/publish/audio',
- name: 'PostPublishAudio',
- component: PostPublishAudio
- },
- {
- path: '/post/edit/audio/:audioId',
- name: 'PostEditAudio',
- component: PostEditAudio
- },
- {
- path: '/post/publish/image',
- name: 'PostPublishAlbum',
- component: PostPublishAlbum
- },
- {
- path: '/post/edit/album/:albumId',
- name: 'PostEditAlbum',
- component: PostEditAlbum
- },
- {
- path: '/post/publish/article',
- name: 'PostPublishArticle',
- component: PostPublishArticle
- },
- {
- path: '/post/list',
- name: 'PostList',
- component: PostList
- },
- {
- path: '/post/video',
- name: 'UserPostVideo',
- component: UserPostVideo
- },
- {
- path: '/post/audio',
- name: 'UserPostAudio',
- component: UserPostAudio
- },
- {
- path: '/post/image',
- name: 'UserPostImage',
- component: UserPostImage
- },
- {
- path: '/post/article',
- name: 'UserPostArticle',
- component: UserPostArticle
- },
- {
- path: '/post/analysis',
- name: 'PostAnalysis',
- component: PostAnalysis
- },
- {
- path: '/message',
- name: 'MessageIndex',
- component: MessageIndex
- },
- {
- path: '*',
- name: '404',
- component: () => import('@/views/404.vue'),
- meta: {
- title: '404'
- }
- }
- ]
- // 创建路由对象
- const router = new VueRouter({
- mode: 'history',
- routes
- })
- // 导出router
- export default router
|