2023-08-19 09:47:46 +00:00
|
|
|
import request from "@/utils/request.js";
|
|
|
|
|
2023-08-19 11:24:24 +00:00
|
|
|
// 发送手机验证码
|
|
|
|
export function sendSmsCode(mobile, scene) {
|
|
|
|
return request.post('app-api/member/auth/send-sms-code', {
|
|
|
|
mobile,
|
|
|
|
scene
|
2023-08-19 15:12:19 +00:00
|
|
|
}, {
|
|
|
|
noAuth: true // TODO 芋艿:后续要做调整
|
2023-08-19 11:24:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 校验手机验证码
|
|
|
|
export function validateSmsCode(mobile, scene, code) {
|
|
|
|
return request.post('app-api/member/auth/validate-sms-code', {
|
|
|
|
mobile,
|
|
|
|
scene,
|
|
|
|
code
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-08-19 09:47:46 +00:00
|
|
|
// 登出系统
|
|
|
|
export function logout() {
|
|
|
|
return request.post('app-api/member/auth/logout');
|
|
|
|
}
|
2023-08-28 11:58:22 +00:00
|
|
|
|
|
|
|
// 使用手机 + 密码登录
|
|
|
|
export function login(data) {
|
|
|
|
return request.post('app-api/member/auth/login', data, {
|
|
|
|
noAuth: true // TODO 芋艿:后续要做调整
|
|
|
|
});
|
|
|
|
}
|
2023-09-09 14:45:58 +00:00
|
|
|
|
|
|
|
// 使用手机 + 验证码登录
|
|
|
|
export function smsLogin(data) {
|
|
|
|
return request.post('app-api/member/auth/sms-login', data, {
|
|
|
|
noAuth: true // TODO 芋艿:后续要做调整
|
|
|
|
});
|
|
|
|
}
|
2023-09-10 10:01:21 +00:00
|
|
|
|
|
|
|
// 社交快捷登录
|
|
|
|
export function socialLogin(type, code, state) {
|
|
|
|
return request.post('app-api/member/auth/social-login', {
|
|
|
|
type,
|
|
|
|
code,
|
|
|
|
state
|
|
|
|
}, {
|
|
|
|
noAuth: true // TODO 芋艿:后续要做调整
|
|
|
|
});
|
|
|
|
}
|
2023-09-10 11:57:10 +00:00
|
|
|
|
|
|
|
// 微信小程序的一键登录登录
|
2023-12-02 02:16:30 +00:00
|
|
|
export function weixinMiniAppLogin(phoneCode, loginCode,state) {
|
2023-09-10 11:57:10 +00:00
|
|
|
return request.post('app-api/member/auth/weixin-mini-app-login', {
|
|
|
|
phoneCode,
|
2023-12-02 02:16:30 +00:00
|
|
|
loginCode,
|
|
|
|
state
|
2023-09-10 11:57:10 +00:00
|
|
|
}, {
|
|
|
|
noAuth: true // TODO 芋艿:后续要做调整
|
|
|
|
});
|
|
|
|
}
|
2023-10-19 13:21:39 +00:00
|
|
|
|
|
|
|
// 创建微信 JS SDK 初始化所需的签名
|
|
|
|
export function createWeixinMpJsapiSignature(url) {
|
|
|
|
return request.post("app-api/member/auth/create-weixin-jsapi-signature?url=" + url, {}, {
|
|
|
|
noAuth: true // TODO 芋艿:后续要做调整
|
|
|
|
});
|
|
|
|
}
|