123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- "use strict";
- const sheep_request_index = require("../../request/index.js");
- const AuthUtil = {
- // 使用手机 + 密码登录
- login: (data) => {
- return sheep_request_index.request({
- url: "/member/auth/login",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: "登录中",
- successMsg: "登录成功"
- }
- });
- },
- // 使用手机 + 验证码登录
- smsLogin: (data) => {
- return sheep_request_index.request({
- url: "/member/auth/sms-login",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: "登录中",
- successMsg: "登录成功"
- }
- });
- },
- // 账号注册
- register: (data) => {
- return sheep_request_index.request({
- url: "/member/auth/sms-register",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: "注册中",
- successMsg: "注册成功"
- }
- });
- },
- // 注册校验用户名是否重复
- verifyUsername: (username) => {
- return sheep_request_index.request({
- url: "/member/user/verifyUsername?username=" + username,
- method: "GET"
- });
- },
- // 发送手机验证码
- sendSmsCode: (mobile, scene) => {
- return sheep_request_index.request({
- url: "/member/auth/send-sms-code",
- method: "POST",
- data: {
- mobile,
- scene
- },
- custom: {
- loadingMsg: "发送中",
- showSuccess: true,
- successMsg: "发送成功"
- }
- });
- },
- // 校验手机验证码
- validatePhone: (mobile, code, scene) => {
- return sheep_request_index.request({
- url: "/member/auth/validate-sms-code",
- method: "POST",
- data: {
- mobile,
- code,
- scene
- }
- });
- },
- // 微信公众号登录选择账号登录
- selectUsernameLogin: (data) => {
- return sheep_request_index.request({
- url: "/member/auth/select-username-login",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: "登录中",
- successMsg: "登录成功"
- }
- });
- },
- // 微信公众号注册
- officialRegister: (data) => {
- return sheep_request_index.request({
- url: "/member/auth/social-register",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: "注册中",
- successMsg: "注册成功"
- }
- });
- },
- // 微信公众号首次登录校验手机
- OfficialEnterLogin: (reqVO, registerReqVO) => {
- return sheep_request_index.request({
- url: "/member/auth/social-login-validate-sms-code",
- method: "POST",
- data: {
- reqVO,
- registerReqVO
- }
- });
- },
- // 登出系统
- logout: () => {
- return sheep_request_index.request({
- url: "/member/auth/logout",
- method: "POST"
- });
- },
- // 刷新令牌
- refreshToken: (refreshToken) => {
- return sheep_request_index.request({
- url: "/member/auth/refresh-token",
- method: "POST",
- params: {
- refreshToken
- },
- custom: {
- loading: false,
- // 不用加载中
- showError: false
- // 不展示错误提示
- }
- });
- },
- // 社交授权的跳转
- socialAuthRedirect: (type, redirectUri) => {
- return sheep_request_index.request({
- url: "/member/auth/social-auth-redirect",
- method: "GET",
- params: {
- type,
- redirectUri
- },
- custom: {
- showSuccess: true,
- loadingMsg: "登陆中"
- }
- });
- },
- // 社交快捷登录
- socialLogin: (type, code, state) => {
- return sheep_request_index.request({
- url: "/member/auth/social-login",
- method: "POST",
- data: {
- type,
- code,
- state
- },
- custom: {
- showSuccess: true,
- loadingMsg: "登陆中"
- }
- });
- },
- // 微信小程序的一键登录
- weixinMiniAppLogin: (phoneCode, loginCode, state) => {
- return sheep_request_index.request({
- url: "/member/auth/weixin-mini-app-login",
- method: "POST",
- data: {
- phoneCode,
- loginCode,
- state
- },
- custom: {
- showSuccess: true,
- loadingMsg: "登陆中",
- successMsg: "登录成功"
- }
- });
- },
- // 创建微信 JS SDK 初始化所需的签名
- createWeixinMpJsapiSignature: (url) => {
- return sheep_request_index.request({
- url: "/member/auth/create-weixin-jsapi-signature",
- method: "POST",
- params: {
- url
- },
- custom: {
- showError: false,
- showLoading: false
- }
- });
- }
- //
- };
- const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: AuthUtil
- }, Symbol.toStringTag, { value: "Module" }));
- exports.AuthUtil = AuthUtil;
- exports.__vite_glob_0_5 = __vite_glob_0_5;
|