12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import request from '@/sheep/request';
- const AuthUtil = {
- // 使用手机 + 验证码登录
- smsLogin: (data) => {
- return request({
- url: '/app-api/member/auth/sms-login',
- method: 'POST',
- data,
- custom: {
- showSuccess: true,
- loadingMsg: '登录中',
- successMsg: '登录成功',
- },
- });
- },
- // 发送手机验证码
- sendSmsCode: (mobile, scene) => {
- return request({
- url: '/app-api/member/auth/send-sms-code',
- method: 'POST',
- data: {
- mobile,
- scene,
- },
- custom: {
- loadingMsg: '发送中',
- showSuccess: true,
- successMsg: '发送成功',
- },
- });
- },
- // 登出系统
- logout: () => {
- return request({
- url: '/app-api/member/auth/logout',
- method: 'POST',
- });
- },
- // 社交授权的跳转
- socialAuthRedirect: (type, redirectUri) => {
- return request({
- url: '/app-api/member/auth/social-auth-redirect',
- method: 'GET',
- params: {
- type,
- redirectUri,
- },
- custom: {
- showSuccess: true,
- loadingMsg: '登陆中',
- },
- });
- },
- // 社交快捷登录
- socialLogin: (type, code, state) => {
- return request({
- url: '/app-api/member/auth/social-login',
- method: 'POST',
- data: {
- type,
- code,
- state,
- },
- custom: {
- showSuccess: true,
- loadingMsg: '登陆中',
- // TODO 芋艿:登录成功???
- },
- });
- },
- // 创建微信 JS SDK 初始化所需的签名
- createWeixinMpJsapiSignature: (url) => {
- return request({
- url: '/app-api/member/auth/create-weixin-jsapi-signature',
- method: 'POST',
- params: {
- url
- },
- custom: {
- showError: false,
- showLoading: false,
- },
- })
- },
- };
- export default AuthUtil;
|