Files
2026-04-14 17:38:46 +08:00

1 line
8.3 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/login/login"],{"092c":function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return r})),t.d(n,"a",(function(){return o}));var o={uSticky:function(){return t.e("components/uview-ui/components/u-sticky/u-sticky").then(t.bind(null,"fb61"))},uNavbar:function(){return t.e("components/uview-ui/components/u-navbar/u-navbar").then(t.bind(null,"816a"))},mploginPopup:function(){return t.e("components/mplogin-popup/mplogin-popup").then(t.bind(null,"a373"))},uInput:function(){return Promise.all([t.e("common/vendor"),t.e("components/uview-ui/components/u-input/u-input")]).then(t.bind(null,"2fc6"))},uVerificationCode:function(){return t.e("components/uview-ui/components/u-verification-code/u-verification-code").then(t.bind(null,"983d"))},uCheckbox:function(){return t.e("components/uview-ui/components/u-checkbox/u-checkbox").then(t.bind(null,"7f15"))},uModal:function(){return t.e("components/uview-ui/components/u-modal/u-modal").then(t.bind(null,"37df"))}},i=function(){var e=this,n=e.$createElement,t=(e._self._c,e.$getImageUri("/images/login_bg.png")),o=e.phoneLogin&&1==e.loginType?e.telephone.length:null;e._isMounted||(e.e0=function(n){e.phoneLogin=!e.phoneLogin},e.e1=function(n){e.isAgreement=!0,e.showModel=!1},e.e2=function(n){e.showModel=!1}),e.$mp.data=Object.assign({},{$root:{m0:t,g0:o}})},r=[]},"39cd":function(e,n,t){"use strict";var o=t("6f1f"),i=t.n(o);i.a},6393:function(e,n,t){"use strict";t.r(n);var o=t("092c"),i=t("bddc");for(var r in i)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(r);t("39cd");var a=t("828b"),u=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);n["default"]=u.exports},"6f1f":function(e,n,t){},"958c":function(e,n,t){"use strict";(function(e,n){var o=t("47a9");t("3712");o(t("3240"));var i=o(t("6393"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(i.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},bddc:function(e,n,t){"use strict";t.r(n);var o=t("e520"),i=t.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(r);n["default"]=i.a},e520:function(e,n,t){"use strict";(function(e){var o=t("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(t("7eb4")),r=o(t("7ca3")),a=o(t("ee10")),u=t("8f59"),c=t("7a03"),s=t("25af"),l=o(t("d3f1")),d=t("0aec"),f=t("f4fb"),p=o(t("3f13")),g=t("d0d1"),h=t("e4fb");function m(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function b(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?m(Object(t),!0).forEach((function(n){(0,r.default)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var v={ACCOUNT_LOGIN:0,SMS_CODE_LOGIN:1},w={data:function(){return{isAgreement:!1,password:"",mobile:"",code:"",isWeixin:"",loginType:0,smsCode:"",codeTips:"",telephone:"",text:"",showLoginPop:!1,loginData:{},showModel:!1,phoneLogin:!1}},onLoad:function(e){var n=this;return(0,a.default)(i.default.mark((function e(){return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:n.mnpLoginFun=(0,d.trottle)(n.mnpLoginFun),n.appWxLogin=(0,d.trottle)(n.appWxLogin),n.getCodeUrl=(0,d.trottle)(n.getCodeUrl);case 3:case"end":return e.stop()}}),e)})))()},onUnload:function(){},methods:b(b(b({},(0,u.mapMutations)(["login"])),(0,u.mapActions)(["getUser"])),{},{isOaWxAuth:function(){var e=this.appConfig.h5_wechat_auth;return e},codeChange:function(e){this.codeTips=e},getCodeUrl:function(){if(!this.isAgreement)return this.showModel=!0;l.default.getWxUrl()},oaLogin:function(e){var n=this;return(0,a.default)(i.default.mark((function t(){var o;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,l.default.authLogin(e);case 2:o=t.sent,n.loginHandle(o);case 4:case"end":return t.stop()}}),t)})))()},oaAutoLogin:function(){var n=this.$Route.query.code;if(this.isWeixin=(0,d.isWeixinClient)(),!this.isLogin)return n?this.oaLogin(n):void 0;e.switchTab({url:"/pages/index/index"})},mnpLoginFun:function(){var n=this;return(0,a.default)(i.default.mark((function t(){var o,r,a,u,s,l,d,f,p;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n.isAgreement){t.next=2;break}return t.abrupt("return",n.showModel=!0);case 2:return t.next=4,(0,h.getUserProfile)();case 4:return o=t.sent,r=o.userInfo,a=r.avatarUrl,u=r.nickName,r.gender,e.showLoading({title:"登录中...",mask:!0}),t.next=12,(0,h.getWxCode)();case 12:return s=t.sent,t.next=15,(0,c.authLogin)({code:s,nickname:u,headimgurl:a});case 15:l=t.sent,d=l.code,f=l.data,p=l.msg,1==d?f.is_new_user?(e.hideLoading(),n.showLoginPop=!0,n.loginData=f):n.loginHandle(f):n.$toast({title:p});case 20:case"end":return t.stop()}}),t)})))()},loginFun:function(){var e=this;return(0,a.default)(i.default.mark((function n(){var t,o,r,a,u,s,l;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t=e.mobile,o=e.password,r=e.telephone,a=e.smsCode,0!=e.loginType){n.next=18;break}if(t){n.next=5;break}return e.$toast({title:"请输入账户/手机号"}),n.abrupt("return");case 5:if(o){n.next=8;break}return e.$toast({title:"请输入密码"}),n.abrupt("return");case 8:if(e.isAgreement){n.next=10;break}return n.abrupt("return",e.showModel=!0);case 10:return n.next=12,(0,c.accountLogin)({mobile:t,password:o,client:d.client});case 12:u=n.sent,s=u.code,l=u.data,1==s&&e.loginHandle(l),n.next=25;break;case 18:if(r){n.next=21;break}return e.$toast({title:"请输入手机号"}),n.abrupt("return");case 21:if(a){n.next=24;break}return e.$toast({title:"请输入验证码"}),n.abrupt("return");case 24:(0,c.smsCodeLogin)({mobile:r,code:a}).then((function(n){1==n.code&&e.loginHandle(n.data)}));case 25:case"end":return n.stop()}}),n)})))()},loginHandle:function(n){var t=this;return(0,a.default)(i.default.mark((function o(){var r;return i.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:t.login(n),e.hideLoading(),r=p.default.get(g.INVITE_CODE),r&&((0,s.bindSuperior)({code:r}),p.default.remove(g.INVITE_CODE)),getCurrentPages().length>1?e.navigateBack({success:function(){var e=(0,d.currentPage)(),n=e.onLoad,t=e.options;n&&n(t)}}):p.default.get(g.BACK_URL)?t.$Router.replace(p.default.get(g.BACK_URL)):t.$Router.pushTab("/pages/index/index"),p.default.remove(g.BACK_URL);case 6:case"end":return o.stop()}}),o)})))()},changeLoginType:function(){this.loginType==v.ACCOUNT_LOGIN?this.loginType=v.SMS_CODE_LOGIN:this.loginType==v.SMS_CODE_LOGIN&&(this.loginType=v.ACCOUNT_LOGIN)},$sendSms:function(){var e=this;this.$refs.uCode.canGetCode&&(this.telephone?(0,c.sendSms)({mobile:this.telephone,key:f.SMSType.LOGIN}).then((function(n){1==n.code&&(e.$refs.uCode.start(),e.$toast({title:n.msg}))})):this.$toast({title:"请输入手机号"}))},appWxLogin:function(){var n=this;return(0,a.default)(i.default.mark((function t(){return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n.isAgreement){t.next=2;break}return t.abrupt("return",n.showModel=!0);case 2:e.login({provider:"weixin",success:function(t){e.showLoading({title:"登录中...",mask:!0});var o=t.authResult,i=o.openid,r=o.access_token;(0,c.opLogin)({openid:i,access_token:r}).then((function(t){e.hideLoading(),1==t.code&&n.loginHandle(t.data)})).catch((function(){e.hideLoading()}))}});case 3:case"end":return t.stop()}}),t)})))()},handleSubmitInfo:function(e){var n=this;return(0,a.default)(i.default.mark((function t(){var o,r;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return o=n.loginData,t.next=3,(0,c.updateUser)(e,o.token);case 3:r=t.sent,1==r.code&&n.loginHandle(o);case 5:case"end":return t.stop()}}),t)})))()},closePopup:function(){this.showLoginPop=!1}}),computed:b(b({},(0,u.mapGetters)(["appConfig"])),{},{isOaWxAutoLogin:function(){return this.appConfig.wechat_h5},$getImageUri:function(){var e=this;return function(n){return e.$store.state.app.config.base_domain+n}},disable:function(){return(!this.mobile||!this.password||0!=this.loginType)&&(11!=this.telephone.length||!this.smsCode||1!=this.loginType)}})};n.default=w}).call(this,t("df3c")["default"])}},[["958c","common/runtime","common/vendor"]]]);