zyejMAll-mobile/sheep/api/member/user.js

85 lines
1.7 KiB
JavaScript
Raw Normal View History

2024-08-07 10:31:42 +08:00
import request from '@/sheep/request';
const UserApi = {
// 获得基本信息
getUserInfo: () => {
return request({
url: '/member/user/get',
method: 'GET',
custom: {
showLoading: false,
auth: true,
},
});
},
// 修改基本信息
updateUser: (data) => {
return request({
url: '/member/user/update',
method: 'PUT',
data,
custom: {
auth: true,
showSuccess: true,
2024-08-07 21:40:27 +08:00
successMsg: '更新成功',
2024-08-07 10:31:42 +08:00
},
});
},
// 修改用户手机
updateUserMobile: (data) => {
return request({
url: '/member/user/update-mobile',
method: 'PUT',
data,
custom: {
loadingMsg: '验证中',
showSuccess: true,
2024-08-07 21:40:27 +08:00
successMsg: '修改成功',
2024-08-07 10:31:42 +08:00
},
});
},
// 基于微信小程序的授权码,修改用户手机
updateUserMobileByWeixin: (code) => {
return request({
url: '/member/user/update-mobile-by-weixin',
method: 'PUT',
data: {
2024-08-07 21:40:27 +08:00
code,
2024-08-07 10:31:42 +08:00
},
custom: {
showSuccess: true,
loadingMsg: '获取中',
2024-08-07 21:40:27 +08:00
successMsg: '修改成功',
2024-08-07 10:31:42 +08:00
},
});
},
// 修改密码
updateUserPassword: (data) => {
return request({
url: '/member/user/update-password',
method: 'PUT',
data,
custom: {
loadingMsg: '验证中',
showSuccess: true,
2024-08-07 21:40:27 +08:00
successMsg: '修改成功',
2024-08-07 10:31:42 +08:00
},
});
},
// 重置密码
resetUserPassword: (data) => {
return request({
url: '/member/user/reset-password',
method: 'PUT',
data,
custom: {
loadingMsg: '验证中',
showSuccess: true,
2024-08-07 21:40:27 +08:00
successMsg: '修改成功',
},
2024-08-07 10:31:42 +08:00
});
},
};
export default UserApi;