mall-uniapp/sheep/api/member/auth.js

57 lines
1.2 KiB
JavaScript
Raw Normal View History

2023-12-17 09:52:49 +00:00
import request from '@/sheep/request';
2023-12-16 13:40:34 +00:00
const AuthUtil = {
2023-12-17 11:29:18 +00:00
// 使用手机 + 验证码登录
smsLogin: (data) => {
return request({
url: '/app-api/member/auth/sms-login',
method: 'POST',
data,
custom: {
showSuccess: true,
loadingMsg: '登录中',
successMsg: '登录成功',
},
});
},
2023-12-17 09:06:11 +00:00
// 发送手机验证码
sendSmsCode: (mobile, scene) => {
return request({
url: '/app-api/member/auth/send-sms-code',
method: 'POST',
data: {
mobile,
2023-12-17 11:29:18 +00:00
scene,
2023-12-17 09:52:49 +00:00
},
custom: {
loadingMsg: '发送中',
showSuccess: true,
2023-12-17 11:29:18 +00:00
successMsg: '发送成功',
},
2023-12-17 09:06:11 +00:00
});
},
2023-12-16 13:40:34 +00:00
// 登出系统
logout: () => {
2023-12-17 09:06:11 +00:00
return request({
2023-12-16 13:40:34 +00:00
url: '/app-api/member/auth/logout',
2023-12-17 11:29:18 +00:00
method: 'POST',
2023-12-16 13:40:34 +00:00
});
},
// 创建微信 JS SDK 初始化所需的签名
createWeixinMpJsapiSignature: (url) => {
return request({
url: '/app-api/member/auth/create-weixin-jsapi-signature',
method: 'POST',
params: {
url
},
custom: {
showError: false,
showLoading: false,
},
})
},
2023-12-16 13:40:34 +00:00
};
export default AuthUtil;