import fetch from '@/api/fetch';

// 获取系统用户列表
export const fetchList = entity =>
  fetch({
    url: '/admin/admin4Page',
    method: 'post',
    data: entity,
  });
// 重置密码
export const resetPwd = entity =>
  fetch({
    url: '/admin/admin4ResetPwd',
    method: 'post',
    data: { ...entity, type: 1 },
  });
// 账号冻结解冻
export const toggleUserFreezeState = entity =>
  fetch({
    url: '/admin/admin4ResetPwd',
    method: 'post',
    data: { ...entity, type: 2 },
  });
// 系统用户新增
export const addAccount = entity =>
  fetch({
    url: '/admin/admin4Add',
    method: 'post',
    data: entity,
  });
// 系统用户修改
export const updateAccount = entity =>
  fetch({
    url: '/admin/admin4Update',
    method: 'post',
    data: entity,
  });
// 获取全部菜单
export const fetchMenuList = () =>
  fetch({
    url: '/admin/menu4List',
    method: 'post',
  });
// 获取全部菜单
export const fetchUserMenuList = entity =>
  fetch({
    url: '/admin/list4MenuAdminRef',
    method: 'post',
    data: entity,
  });
// 用户授权菜单
export const updateUserAuthMenu = entity =>
  fetch({
    url: '/admin/admin4Author',
    method: 'post',
    data: entity,
  });