85 lines
1.8 KiB
JavaScript
85 lines
1.8 KiB
JavaScript
export default {
|
|
// 登录方法
|
|
login: function(username, password, smscode, uuid) {
|
|
const data = {
|
|
username,
|
|
password,
|
|
smscode,
|
|
uuid
|
|
}
|
|
return request({
|
|
'url': apis.UserLogin,
|
|
headers: {
|
|
isToken: false
|
|
},
|
|
'method': 'post',
|
|
'data': data
|
|
})
|
|
},
|
|
|
|
// 注册方法
|
|
register: function(data) {
|
|
return request({
|
|
url: apis.UserReg,
|
|
headers: {
|
|
isToken: false
|
|
},
|
|
method: 'post',
|
|
data: data
|
|
})
|
|
},
|
|
|
|
// 获取用户详细信息
|
|
getInfo: function() {
|
|
return request({
|
|
'url': apis.UserDetail,
|
|
'method': 'get'
|
|
})
|
|
},
|
|
|
|
// 退出方法
|
|
logout: function() {
|
|
return request({
|
|
'url': userLogout,
|
|
'method': 'post'
|
|
})
|
|
},
|
|
// 用户密码重置
|
|
updateUserPwd: function(oldPassword, newPassword) {
|
|
const data = {
|
|
oldPassword,
|
|
newPassword
|
|
}
|
|
return request({
|
|
url: '/system/user/profile/updatePwd',
|
|
method: 'put',
|
|
params: data
|
|
})
|
|
},
|
|
|
|
// 查询用户个人信息
|
|
getUserProfile: function() {
|
|
return request({
|
|
url: '/system/user/profile',
|
|
method: 'get'
|
|
})
|
|
},
|
|
|
|
// 修改用户个人信息
|
|
updateUserProfile: function(data) {
|
|
return request({
|
|
url: '/system/user/profile',
|
|
method: 'put',
|
|
data: data
|
|
})
|
|
},
|
|
|
|
// 用户头像上传
|
|
uploadAvatar: function(data) {
|
|
return upload({
|
|
url: '/system/user/profile/avatar',
|
|
name: data.name,
|
|
filePath: data.filePath
|
|
})
|
|
}
|
|
} |