const tokens = {
  admin: "admin-token",
  guest: "guest-token",
  editor: "editor-token",
};

const users = {
  "admin-token": {
    id: "admin",
    role: "admin",
    name: "难凉热血",
    avatar: "https://s1.ax1x.com/2020/04/28/J5hUaT.jpg",
    description: "拥有系统内所有菜单和路由权限",
  },
  "editor-token": {
    id: "editor",
    role: "editor",
    name: "编辑员",
    avatar: "https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png",
    description:"可以看到除户管理页面之外的所有页面",
  },
  "guest-token": {
    id: "guest",
    role: "guest",
    name: "游客",
    avatar: "https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png",
    description:"仅能看到Dashboard、开发文档、权限测试和关于作者四个页面",
  },
};

export default {
  login: (config) => {
    console.log({config})
    const { username } = JSON.parse(config.body);
    const token = tokens[username];
    if (!token) {
      return {
        status: 1,
        message: "用户名或密码错误",
      };
    }
    return {
      status: 0,
      token,
    };
  },
  logout: (_) => {
    return {
      status: 0,
      data:{
        data: "success",
        status:200
      },
    };
  },
  situationList:()=>{
    return {
      status:200,
      data:[
        {
          checkGroupId: 1,
          checkGroupName: "查核组",
          checkStatus: "第1/1次查核计划进行中",
          id: 152,
          name: "5.8测试",
          nextCheckTime: "无",
          toDistributeCount: 1,
          topic: 0
        },
        {
          checkGroupId: 1,
          checkGroupName: "查核组",
          checkStatus: "第3/7次查核计划进行中",
          id: 151,
          name: "TTTTTT",
          nextCheckTime: "2021年05月11日",
          toDistributeCount: 6,
          topic: 1
        },
        {
          checkGroupId: 1,
          checkGroupName: "查核组",
          checkStatus: "第4/22次查核计划进行中",
          id: 150,
          name: "hhz",
          nextCheckTime: "2021年05月11日",
          toDistributeCount: 20,
          topic: 0
        },
        {
          checkGroupId: 1,
          checkGroupName: "查核组",
          checkStatus: "第1/6次查核计划进行中",
          id: 149,
          name: "追踪多查核组情况",
          nextCheckTime: "2021年05月26日",
          toDistributeCount: 4,
          topic: 0
        },
        {
          checkGroupId: 1,
          checkGroupName: "查核组",
          checkStatus: "第1/6次查核计划进行中",
          id: 149,
          name: "追踪多查核组情况",
          nextCheckTime: "2021年05月26日",
          toDistributeCount: 4,
          topic: 0
        }
      ]
    }
  },
  conditionList:()=>{
    return {
      status:200,
      data:[
         {
          child: [],
          description: "测试条件",
          id: 6042,
          name: "测试条件22",
          parentId: 0
         },
         {
          child: [
             {
              description: "",
              id: 21,
              name: "住院",
              parentId: 20,
              child:[
                {
                  child: [],
                  description: "",
                  id: 23,
                  name: "RCC",
                  parentId: 21
                }
              ]
             }
          ],
          description: "",
          id: 20,
          name: "急诊",
          parentId: 0
         }
      ]
    }
  }
};
