mall-app-t/peach/api/member/auth.js

57 lines
1.5 KiB
JavaScript

import request from '@/peach/request'
const AuthUtil = {
smsLogin: (data) => {
return request({
url: '/particulars/member/auth/sms-login',
method: 'POST',
data,
custom: {
showSuccess: true,
loadingMsg: '登陆中',
successMsg: '登陆成功',
auth: false,
},
})
},
// 退出登陆
logout: () => {
return request({
url: '/particulars/member/auth/logout',
method: 'POST',
})
},
// 发送手机验证码
sendSmsCode: (mobile, scene) => {
return request({
url: '/member/auth/send-sms-code',
method: 'POST',
data: {
mobile,
scene,
},
custom: {
loadingMsg: '发送中',
showSuccess: true,
successMsg: '发送成功',
},
})
},
// 刷新令牌
refreshToken: (refreshToken) => {
return request({
url: '/particulars/member/auth/refresh-token',
method: 'POST',
params: {
refreshToken,
},
custom: {
loading: false, // 不用加载中
showError: false, // 不展示错误提示
},
})
},
}
export default AuthUtil