/*
 * @Description:: 请补充填写
 * @Version: 请配置版本号
 * @Author: 舟舟
 * @Date: 2022-06-25 22:54:40
 * @LastEditors: 舟舟
 * @LastEditTime: 2022-08-03 21:12:42
 * @FilePath: /ouicai_web_framework_vite_ep_nolang/src/router/static.ts
 */
/*
 * 静态路由
 */
import { RouteRecordRaw } from 'vue-router'

const staticRoutes: Array<RouteRecordRaw> = [
    {
        path: '/',
        // name: '/',
        // component: () => import('/@/views/frontend/index.vue'),
        // meta: {
        //     title: '首页', // 首页
        // },
        redirect:'/admin/login'
    },
    {
        path: '/admin/login',
        name: 'adminLogin',
        component: () => import('/@/views/backend/login.vue'),
        meta: {
            title: '车位销售运营管理平台', // 管理员登录页
        },
    },
    {
        path: '/:path(.*)*',
        redirect: '/404',
    },
    {
        path: '/404',
        name: 'notFound',
        component: () => import('/@/views/common/error/404.vue'),
        meta: {
            title: '页面不存在', // 页面不存在
        },
    },
    {
        // 后台找不到页面了-可能是路由未加载上
        path: '/admin:path(.*)*',
        redirect: (to) => {
            return { name: 'adminMainLoading', query: { url: to.path, query: JSON.stringify(to.query) } }
        },
    },
    {
        path: '/401',
        name: 'noPower',
        component: () => import('/@/views/common/error/401.vue'),
        meta: {
            title: '无权限访问', // 无权限访问
        },
    },
    {
        path: '/mobileUpload',
        name: 'mobileupload',
        component: () => import('/@/views/backend/mobileUpload.vue'),
        meta: {
            title: '图片上传', // 无权限访问
        },
    },
    {
        path: '/documentview',
        name: 'documentview',
        component: () => import('/@/views/frontend/documentview.vue'),
        meta: {
            title: '详情', // 首页
        },
    },
    {
        path: '/helpcenter',
        name: 'helpcenter',
        component: () => import('/@/views/frontend/helpcenter.vue'),
        meta: {
            title: '帮助中心', // 首页
        },
    },{
        path: '/helpcenter/detail',
        name: 'helpdetail',
        component: () => import('/@/views/frontend/helpdetail.vue'),
        meta: {
            title: '帮助详情', // 首页
        },
    },{
        path: '/goodview',
        name: 'goodview',
        component: () => import('/@/views/frontend/goodview.vue'),
        meta: {
            title: '产品详情', // 首页
        },
    },{
        path: '/back',
        name: 'back',
        component: () => import('/@/views/backend/back.vue'),
        meta: {
            title: '', // 首页
        },
    }
]

// 后台基础路由和静态路由
const adminBaseRoute: RouteRecordRaw = {
    path: '/admin',
    name: 'admin',
    component: () => import('/@/layouts/backend/index.vue'),
    redirect: '/admin/loading',
    meta: {
        title: '管理平台',
    },
    children: [
        {
            path: 'loading',
            name: 'adminMainLoading',
            component: () => import('/@/views/backend/loading.vue'),
            meta: {
                title: '正在登录',
            },
        },
        {
            path: 'iframe/:url',
            name: 'layoutIframe',
            component: () => import('/@/layouts/router-view/iframe.vue'),
            meta: {
                title: '内嵌Iframe',
            },
        },
    ],
}

staticRoutes.push(adminBaseRoute)

export { staticRoutes, adminBaseRoute }
