import request from '@/utils/request'

// 登录
export function login(params) {
  return request({
    url: '/admin/user/login',
    method: 'post',
    params
  })
}

// 获取用户信息
export function getInfo(userid) {
  return request({
    url: '/admin/user/detail',
    method: 'get',
    params: { adminUserId: userid }
  })
}

// 动态路由
export function getRouter(params) {
  return request({
    url: `/admin/user/module/list`,
    method: 'get',
    params
  })
}

// 退出登录
export function logout() {
  return request({
    url: '/admin/user/logout',
    method: 'post'
  })
}

// 动态路由
export function getCode() {
  return request({
    url: '/admin/user/imageVerification',
    method: 'get'
  })
}

// 获取轮播图

export function getList() {
  return request({
    url: '/record/list',
    method: 'get'
  })
}

// 公司列表

export function getCompanyList() {
  return request({
    url: '/record/company/list',
    method: 'get'
  })
}
// 登录时发送验证码
export function getAdminUserSmsCode(params) {
  return request({
    url: '/admin/user/smsCode',
    method: 'post',
    params
  })
}

// 保存配置的列表字段
export function zfireSave(data, moduleId) {
  return request({
    url: `/zfire/save?moduleId=${moduleId}`,
    method: "post",
    data
  });
}
// 删除配置的列表字段

export function zfireDel(data, adminUserId, moduleId) {
  return request({
    url: `/zfire/delete?adminUserId=${adminUserId}&moduleId=${moduleId}`,
    method: "post",
    data
  });
}

// 下拉框查询
export function commonDict(params) {
  return request({
    url: "/common/dict/listDict",
    method: "get",
    params
  });
}
