import { request } from 'umi';
//import api from './apibase';
//例子
export default {
  //登录
  Login(parms) {
    return request('/kitchen/api/login', {
      method: 'POST',
      data: {
        ...parms,
      },
    });
  },
  //获取个人信息
  queryCurrent() {
    return request('/kitchen/api/getLoginUser');
  },

  //同步菜单数据到数据库
  queryAndSyncMenu(args) {
    return request('/kitchen/api/auth/syncmenus', { method: 'post', data: args });
  },
  //动态菜单
  DymicMenus(userid) {
    return request(`/kitchen/api/menu/menutree`, { method: 'get' });
  },
  //登出
  outLogin() {
    return request('/kitchen/api/logout');
  },
  getFakeCaptcha(params, options) {
    return request(url, '/kitchen/api/login/captcha', {
      method: 'POST',
      params: { ...params },
      headers: {
        Accept: 'application/json',
        'Content-Type': 'application/json; charset=utf-8',
        Authorization: authorization(noAuth),
      },
    });
  },
};
