import upload from '@/utils/upload'
import request from '@/utils/request'

// 用户密码修改
export function updateUserPwd(oldPassword,newPassword) {
  const data = {
	oldPassword,
    newPassword
  }
  return request({
    url: '/system/user/profile/updatePwd',
    method: 'post',
    params: data
  })
}
// 上传图片
export function uploadPhoto(data) {
  return upload({
    url: '/common/upload',
    name: data.name,
    filePath: data.filePath
  })
}
// 查询用户个人信息
export function getUserProfile() {
  return request({
    url: '/system/user/profile',
    method: 'get'
  })
}

// 修改用户个人信息
export function updateUserProfile(data) {
  return request({
    url: '/system/user/profile',
    method: 'put',
    data: data
  })
}

// 用户头像上传
export function uploadAvatar(data) {
  return upload({
    url: '/system/user/profile/avatar',
    name: data.name,
    filePath: data.filePath
  })
}


// 获取部门
export function gettreeselect(data) {
  return request({
    url: '/system/dept/treeselect',
    method: 'get',
    data: data
  })
}
//部门接口 
export function getfgwtreeFn(data) {
  return request({
    url: '/system/dept/fgw/treeselect',
    method: 'get',
	data:data
  })
}
// 下载版本更新
export function findVersion(data) {
  return request({
    url: '/system/app/new',
    method: 'get',
    data: data
  })
}