/**
 * @description 静态路由
 * @license Apache License Version 2.0
 * @Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
 * @remarks
 * SimpleAdmin 基于 Apache License Version 2.0 协议发布，可用于商业项目，但必须遵守以下补充条款:
 * 1.请不要删除和修改根目录下的LICENSE文件。
 * 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
 * 3.分发源码时候，请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
 * 4.基于本软件的作品，只能使用 SimpleAdmin 作为后台服务，除外情况不可商用且不允许二次分发或开源。
 * 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为，不能以任何形式用于非法为目的的行为不要删除和修改作者声明。
 * 6.任何基于本软件而产生的一切法律纠纷和责任，均于我司无关
 * @see https://gitee.com/dotnetmoyu/SimpleAdmin
 */
import { RouteRecordRaw } from "vue-router";
import { HOME_URL, LOGIN_URL } from "@/config";

/**
 * staticRouter (静态路由)
 */
export const staticRouter: RouteRecordRaw[] = [
  {
    path: "/",
    redirect: HOME_URL
  },
  {
    path: LOGIN_URL,
    name: "login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      title: "登录"
    }
  },
  {
    path: "/layout",
    name: "layout",
    component: () => import("@/layouts/index.vue"),
    // component: () => import("@/layouts/indexAsync.vue"),
    redirect: HOME_URL,
    children: [
      {
        meta: {
          title: "学生点名详情"
        },
        name: "学生点名详情",
        path: "/attendance/roolcall/detail",
        component: () => import("@/views/attendance/roolcall/detail.vue")
      },
      {
        meta: {
          title: "学生画像详情"
        },
        name: "学生画像详情",
        path: "/violation/portrait/detail",
        component: () => import("@/views/violation/portrait/detail.vue")
      }
    ]
  },
  // AI智能预警分析平台
  {
    path: "/screen",
    name: "AI智能预警分析平台",
    component: () => import("@/views/screen/index.vue"),
    meta: {
      title: "AI智能预警分析平台"
    },
  },
  {
    name: "AI智能预警分析平台-智慧课堂",
    meta: {
      title: "AI智能预警分析平台-智慧课堂"
    },
    path: "/screen/classroom",
    component: () => import("@/views/screen/classroom.vue")
  },
  {
    name: "AI智能预警分析平台-学生归寝",
    meta: {
      title: "AI智能预警分析平台-学生归寝"
    },
    path: "/screen/stureturn",
    component: () => import("@/views/screen/stureturn.vue")
  },
];

/**
 * errorRouter (错误页面路由)
 */
export const errorRouter = [
  {
    path: "/403",
    name: "403",
    component: () => import("@/components/ErrorMessage/403.vue"),
    meta: {
      title: "403页面"
    }
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/components/ErrorMessage/404.vue"),
    meta: {
      title: "404页面"
    }
  },
  {
    path: "/500",
    name: "500",
    component: () => import("@/components/ErrorMessage/500.vue"),
    meta: {
      title: "500页面"
    }
  },
  // Resolve refresh page, route warnings
  {
    path: "/:pathMatch(.*)*",
    component: () => import("@/components/ErrorMessage/404.vue")
  }
];
