import fly from '@/utils/request'
export function login(username, password) {
  const data = {
    username,
    password
  }
  return fly.post('/login',data,{headers:{isToken:false}}).then(res => res)
}
// 获取用户详细信息
export function getInfo() {
  return fly.get('/getInfo').then(res=>res)
}
//修改用户信息
export function saveUserInfo(data){
	return fly.put('/system/user/profile',data).then(res=>res)
}
//修改用户密码
export function savePassword(oldPwd,newPwd){
	return fly.put('/system/user/profile/updatePwd',{
		oldPassword:oldPwd,
		newPassword:newPwd
	}).then(res=>res)
}
//退出
export function logout(){
	return fly.post('/logout').then(res=>res)
}
