import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Index from '@/components/Index'
import Home from '@/components/Home'
import Regist from '@/components/Regist'
import Forget from '@/components/Forget'
import Publish from '@/components/Publish'
import Mission from '@/components/Mission'
import Translate from '@/components/Translate'
import Proof from '@/components/Proof'
import Person from '@/components/Person'
import Follow from '@/components/Follow'
import Letter from '@/components/Letter'
import Setting from '@/components/Setting'
import Message from '@/components/Message'
import User from '@/components/User'

Vue.use(Router)

export default new Router({
    mode: 'history',
    routes: [
        {
            path: '/',
            name: 'index',
            component: Index,
            children: [
                {
                    path: '',
                    component: Home
                },
                {
                    path: 'login',
                    component: Login
                },
                {
                    path: 'reg',
                    component: Regist
                },
                {
                    path: 'forget',
                    component: Forget
                },
                {
                    path: 'publish',
                    component: Publish
                },
                {
                    path: 'mission/:id',
                    component: Mission
                },
                {
                    path: 'trans/:id',
                    component: Translate
                },
                {
                    path: 'proof/:id/:type',
                    component: Proof
                },
                {
                    path: 'person',
                    component: Person
                },
                {
                    path: 'person/:userid',
                    component: User
                },
                {
                    path: 'follow/:userid',
                    component: Follow
                },
                {
                    path: 'letter/:userid',
                    component: Letter
                },
                {
                    path: 'setting',
                    component: Setting
                },
                {
                    path: 'message',
                    component: Message
                }
            ]
        }
    ]
})
