/*
 * @Author: donghao donghao@supervision.ltd
 * @Date: 2024-01-12 14:35:28
 * @LastEditors: donghao donghao@supervision.ltd
 * @LastEditTime: 2024-01-17 11:09:58
 * @FilePath: \general-work-web\General-AI-Platform-Web-Client\mock\asyncRoutes.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 模拟后端动态生成路由
import { MockMethod } from "vite-plugin-mock";
// import { useI18n } from "vue-i18n";

// const { t } = useI18n();
/**
 * roles：页面级别权限，这里模拟二种 "admin"、"common"
 * admin：管理员角色
 * common：普通角色
 */

const demoRouter = {
  path: "/demo/leftTree",
  name: "DemoLeftTree",
  meta: {
    title: "测试",
    icon: "",
    roles: ["admin", "common"],
    rank: 101
  }
};

export default [
  {
    url: "/getAsyncRoutes",
    method: "get",
    response: () => {
      return {
        success: true,
        data: [demoRouter]
      };
    }
  }
] as MockMethod[];
