import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function getAllDictionary() {
  return request({
    url: '/dictionary/getAllDictionary',
    method: 'get'
  })
}

export function getHospitalList() {
  return request({
    url: '/hospital/hospitalList',
    method: 'get'
  })
}

export function sendVerificationCode(emailOrPhone) {
  return request({
    url: `/user/sendVerificationCode/${emailOrPhone}`,
    method: 'get'
  })
}
export function anonymousSendVerificationCode(emailOrPhone) {
  return request({
    url: `/user/anonymousSendVerificationCode/${emailOrPhone}`,
    method: 'get'
  })
}

export function verifyAnonymousVerifyCode(email, verifyCode) {
  return request({
    url: `/User/verifyAnonymousVerifyCode/${email}/${verifyCode}`,
    method: 'get'
  })
}

export function anonymousSetPassword(userId, newPwd) {
  return request({
    url: `/User/anonymousSetPassword/${userId}/${newPwd}`,
    method: 'get'
  })
}
export function setNewPassword(param) {
  return request({
    url: `/user/setNewPassword`,
    method: 'post',
    data: param
  })
}

export function getUserMenuTree() {
  return request({
    url: `/Menu/getUserMenuTree`,
    method: 'get'
  })
}

export function getUserPermissions() {
  return request({
    url: `/Menu/getUserPermissions`,
    method: 'get'
  })
}

export function getDoctorShortcutKey(params) {
  return request({
    url: `/ShortcutKey/getDoctorShortcutKey`,
    method: 'post',
    data: params
  })
}

export function setShortcutKey(params) {
  return request({
    url: `/ShortcutKey/setShortcutKey`,
    method: 'post',
    data: params
  })
}

export function restoreDefaultShortcutKey(params) {
  return request({
    url: `/ShortcutKey/restoreDefaultShortcutKey`,
    method: 'post',
    data: params
  })
}
