{"version":3,"file":"auth.js","sources":["../../../../../../src/sheep/api/member/auth.js"],"sourcesContent":["import request from '@/sheep/request'\r\n\r\nconst AuthUtil = {\r\n // 使用手机 + 密码登录\r\n login: (data) => {\r\n return request({\r\n url: '/member/auth/login',\r\n method: 'POST',\r\n data,\r\n custom: {\r\n showSuccess: true,\r\n loadingMsg: '登录中',\r\n successMsg: '登录成功',\r\n },\r\n })\r\n },\r\n // 使用手机 + 验证码登录\r\n smsLogin: (data) => {\r\n return request({\r\n url: '/member/auth/sms-login',\r\n method: 'POST',\r\n data,\r\n custom: {\r\n showSuccess: true,\r\n loadingMsg: '登录中',\r\n successMsg: '登录成功',\r\n },\r\n })\r\n },\r\n // 发送手机验证码\r\n sendSmsCode: (mobile, scene) => {\r\n return request({\r\n url: '/member/auth/send-sms-code',\r\n method: 'POST',\r\n data: {\r\n mobile,\r\n scene,\r\n },\r\n custom: {\r\n loadingMsg: '发送中',\r\n showSuccess: true,\r\n successMsg: '发送成功',\r\n },\r\n })\r\n },\r\n // 登出系统\r\n logout: () => {\r\n return request({\r\n url: '/member/auth/logout',\r\n method: 'POST',\r\n })\r\n },\r\n // 刷新令牌\r\n refreshToken: (refreshToken) => {\r\n return request({\r\n url: '/member/auth/refresh-token',\r\n method: 'POST',\r\n params: {\r\n refreshToken,\r\n },\r\n custom: {\r\n loading: false, // 不用加载中\r\n showError: false, // 不展示错误提示\r\n },\r\n })\r\n },\r\n // 社交授权的跳转\r\n socialAuthRedirect: (type, redirectUri) => {\r\n return request({\r\n url: '/member/auth/social-auth-redirect',\r\n method: 'GET',\r\n params: {\r\n type,\r\n redirectUri,\r\n },\r\n custom: {\r\n showSuccess: true,\r\n loadingMsg: '登陆中',\r\n },\r\n })\r\n },\r\n // 社交快捷登录\r\n socialLogin: (type, code, state) => {\r\n return request({\r\n url: '/member/auth/social-login',\r\n method: 'POST',\r\n data: {\r\n type,\r\n code,\r\n state,\r\n },\r\n custom: {\r\n showSuccess: true,\r\n loadingMsg: '登陆中',\r\n },\r\n })\r\n },\r\n // 微信小程序的一键登录\r\n weixinMiniAppLogin: (phoneCode, loginCode, state) => {\r\n return request({\r\n url: '/member/auth/weixin-mini-app-login',\r\n method: 'POST',\r\n data: {\r\n phoneCode,\r\n loginCode,\r\n state,\r\n },\r\n custom: {\r\n showSuccess: true,\r\n loadingMsg: '登陆中',\r\n successMsg: '登录成功',\r\n },\r\n })\r\n },\r\n // 创建微信 JS SDK 初始化所需的签名\r\n createWeixinMpJsapiSignature: (url) => {\r\n return request({\r\n url: '/member/auth/create-weixin-jsapi-signature',\r\n method: 'POST',\r\n params: {\r\n url,\r\n },\r\n custom: {\r\n showError: false,\r\n showLoading: false,\r\n },\r\n })\r\n },\r\n //\r\n}\r\n\r\nexport default AuthUtil\r\n"],"names":["request"],"mappings":";;AAEK,MAAC,WAAW;AAAA;AAAA,EAEf,OAAO,CAAC,SAAS;AACf,WAAOA,4BAAQ;AAAA,MACb,KAAK;AAAA,MACL,QAAQ;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,QACN,aAAa;AAAA,QACb,YAAY;AAAA,QACZ,YAAY;AAAA,MACb;AAAA,IACP,CAAK;AAAA,EACF;AAAA;AAAA,EAED,UAAU,CAAC,SAAS;AAClB,WAAOA,4BAAQ;AAAA,MACb,KAAK;AAAA,MACL,QAAQ;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,QACN,aAAa;AAAA,QACb,YAAY;AAAA,QACZ,YAAY;AAAA,MACb;AAAA,IACP,CAAK;AAAA,EACF;AAAA;AAAA,EAED,aAAa,CAAC,QAAQ,UAAU;AAC9B,WAAOA,4BAAQ;AAAA,MACb,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,MAAM;AAAA,QACJ;AAAA,QACA;AAAA,MACD;AAAA,MACD,QAAQ;AAAA,QACN,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,YAAY;AAAA,MACb;AAAA,IACP,CAAK;AAAA,EACF;AAAA;AAAA,EAED,QAAQ,MAAM;AACZ,WAA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