

import { createRouter, createWebHistory, createWebHashHistory, RouteRecordRaw } from "vue-router";

import { authGuard } from './plugins/authGuard'

import otaRoutes from "./module/ota";

const routes: RouteRecordRaw[] = [
    {
        path: "/",
        redirect: "/home"
    },
    {
        path: "/home",
        name: "home",
        component: () => import("@/views/Home/index.vue"),
        meta: {
            title: '首页',
            noAuth: true,
        },
    },
    {
        path: "/setting",
        name: "setting",
        component: () => import("@/views/Setting/index.vue"),
        meta: {
            title: '设置'
        }
    },
    {
        path: "/photography/check",
        name: "PhotographyCheck",
        component: () => import("@/views/Photography/check.vue"),
        meta: {
            title: '拍摄物体镜头矫正'
        }
    },
    {
        path: "/photography/shot",
        name: "PhotographyShot",
        component: () => import("@/views/Photography/shot.vue"),
        meta: {
            title: '拍摄商品'
        }
    },
    {
        path: "/photography/detail",
        name: "PhotographyDetail",
        component: () => import("@/views/Photography/detail.vue"),
        meta: {
            title: '主图与详情生成'
        }
    },
    {
        path: "/photography/seniorDetail",
        name: "PhotographySeniorDetail",
        component: () => import("@/views/Photography/seniorDetail.vue"),
        meta: {
            title: '详情高级配置'
        }
    },
    {
        path: "/remote_control",
        name: "RemoteControl",
        component: () => import("@/views/RemoteControl/index.vue"),
        meta: {
            title: '遥控器'
        }
    },
    {
        path: "/developer",
        name: "developer",
        component: () => import("@/views/Developer/index.vue"),
        meta: {
            title: '初始设备调频设置'
        }
    },
    ...otaRoutes,
];

const router = createRouter({
    history: createWebHashHistory(), // 修改: 将 createWebHistory 改为 createWebHashHistory
    routes
});

authGuard(router)

export default router;
