import { http } from '@/util'

const base = '/system/user/profile'

export const profile = ()=>http.get(base)

export const update = (data)=>http.put(base,data)

export const updatePwd = (oldPassword,newPassword)=>http.put(base+'/updatePwd',{newPassword,oldPassword},{custom:{type:'form'}})

export const bindUserName = (userName)=>http.put(base+'/bindUserName',{userName},{custom:{type:'form'}})

export const avatar = (file)=>http.upload(base+"/avatar",{
	custom:{type:'none'},
	filePath:file,
	name:"avatarfile",
	timeout: 60000
});


