import request from '@/utils/request'

export function GetElectronicSignature() {
  return request({
    url: '/m/api/getelectronicsignature',
    method: 'get'
  })
}

export function SaveElectronicSignature(es, id) {
  console.log('id', id)
  console.log('es', es)
  return request({
    url: '/m/api/savelectronicsignature?id=' + id,
    method: 'post',
    data: es
  })
}

export function GetMyInfo() {
  return request({
    url: '/m/api/my',
    method: 'get'
  })
}

export function GetAllStaff() {
  return request({
    url: '/m/api/staff',
    method: 'get'
  })
}

export function EditAdmin(params) {
  return request({
    url: '/m/api/staff/edit',
    method: 'post',
    params: params
  })
}

export function AdminInitData() {
  return request({
    url: '/m/api/staff/init',
    method: 'get'
  })
}

export function GetAdminUserInfo(params) {
  return request({
    url: '/m/api/staff/get',
    method: 'get',
    params: params
  })
}

export function StopAdminUser(params) {
  return request({
    url: '/m/api/staff/stop',
    method: 'post',
    params: params
  })
}

export function CreateAdminUser(params) {
  return request({
    url: '/m/api/staff/create',
    method: 'post',
    params: params
  })
}

export function CreateRole(params) {
  return request({
    url: '/m/api/role/create',
    method: 'post',
    params: params
  })
}

export function GetAllPurview(params) {
  return request({
    url: '/m/api/permission',
    method: 'get',
    params: params
  })
}

export function GetRoleInfo(params) {
  return request({
    url: '/m/api/rolepurview',
    method: 'get',
    params: params
  })
}

export function EditRoleInfo(params) {
  return request({
    url: '/m/api/role/edit',
    method: 'post',
    params: params
  })
}

export function DeleteRoleInfo(params) {
  return request({
    url: '/m/api/role/del',
    method: 'post',
    params: params
  })
}

export function AddUserRole(params) {
  return request({
    url: '/m/api/role/addStaff',
    method: 'post',
    params: params
  })
}

export function GetAllFunctionPurview(pid) {
  return request({
    url: '/m/api/role/funtionpurview?pid='+pid,
    method: 'get'
  })
}

export function EditPurview(params) {
  return request({
    url: '/m/api/permission/post',
    method: 'post',
    params: params
  })
}

export function EditFuncPurview(params) {
  return request({
    url: '/m/api/functionpermission/post',
    method: 'post',
    params: params
  })
}

export function GetFunctionRoleInfo(params) {
  return request({
    url: '/m/api/func_role/get',
    method: 'get',
    params: params
  })
}

export function GetAllRole() {
  return request({
    url: '/m/api/role',
    method: 'get'
  })
}

export function GetNewPurview(params) {
  return request({
    url: '/m/api/newpermission',
    method: 'get',
    params: params
  })
}



export function GetDepartment() {
  return request({
    url: '/m/api/department/get',
    method: 'get',
  })
}



