import request from './request'

export function apiLogin(payload){
  return request.post('/common/auth/login', payload)
}

export function apiqrcode(){
  return request.get('/qrcode/url')
}

export function getMenus(){
  return request.get('/common/nav/categories/complete')
}

export function getUser(){
  return request.get('/common/user/info')
}
export function apiRefreshToken(payload){
  return request.post('/common/auth/refresh/token', payload)
}
//获取微信用户信息
export function getWechatUserInfo(params){
  // 通过 code / state 向后端换取微信用户信息
  return request.get('/user/info', { params })
}

// 绑定微信到系统账户（姓名/手机号/编号/密码）
export function bindWechatAccount(payload){
  return request.post('/bind/user', payload)
}
//更新用户信息
export function updateUserInfo(payload){
  return request.put('/admin/user/edit', payload)
}
//重置密码
export function resetPassword(payload){
  return request.put('/common/user/update/password', payload)
}
//图片上传
export function uploadImage(payload){
  return request.post('/upload/image', payload)
}
export function getconfig(params){
  return request.get('/common/config/find',{params})
}