(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/login/login"],{86:function(e,n,t){"use strict";(function(e,n){var r=t(4);t(26);r(t(25));var o=r(t(87));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t(1)["default"],t(2)["createPage"])},87:function(e,n,t){"use strict";t.r(n);var r=t(88),o=t(90);for(var u in o)["default"].indexOf(u)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(u);t(97);var s,i=t(32),a=Object(i["default"])(o["default"],r["render"],r["staticRenderFns"],!1,null,null,null,!1,r["components"],s);a.options.__file="pages/login/login.vue",n["default"]=a.exports},88:function(e,n,t){"use strict";t.r(n);var r=t(89);t.d(n,"render",(function(){return r["render"]})),t.d(n,"staticRenderFns",(function(){return r["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return r["recyclableRender"]})),t.d(n,"components",(function(){return r["components"]}))},89:function(e,n,t){"use strict";var r;t.r(n),t.d(n,"render",(function(){return o})),t.d(n,"staticRenderFns",(function(){return s})),t.d(n,"recyclableRender",(function(){return u})),t.d(n,"components",(function(){return r}));try{r={uInput:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-input/u-input")]).then(t.bind(null,200))},uCheckbox:function(){return t.e("uview-ui/components/u-checkbox/u-checkbox").then(t.bind(null,208))},uImage:function(){return t.e("uview-ui/components/u-image/u-image").then(t.bind(null,179))},uModal:function(){return t.e("uview-ui/components/u-modal/u-modal").then(t.bind(null,193))}}}catch(i){if(-1===i.message.indexOf("Cannot find module")||-1===i.message.indexOf(".vue"))throw i;console.error(i.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范，文档：https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范，需手动引入，并在 components 中注册该组件")}var o=function(){var e=this,n=e.$createElement;e._self._c;e._isMounted||(e.e0=function(n){e.radio=!e.radio},e.e1=function(n){e.show=!1})},u=!1,s=[];o._withStripped=!0},90:function(e,n,t){"use strict";t.r(n);var r=t(91),o=t.n(r);for(var u in r)["default"].indexOf(u)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(u);n["default"]=o.a},91:function(e,n,t){"use strict";(function(e){var r=t(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=r(t(43)),u=r(t(45)),s=t(92),i={data:function(){return{form:{username:"",password:""},checked:!1,radio:!1,isButtonDisabled:!1,show:!1,customStyle:{with:"100%",backgroundColor:"#ffffff",fontSize:"32rpx"}}},onLoad:function(){var n=e.getStorageSync("username"),t=e.getStorageSync("password");n&&t?(this.form.username=n,this.form.password=t,this.checked=!0):n&&(this.form.username=n)},methods:{login:function(){if(this.radio){if(this.isButtonDisabled)return!1;if(!this.form.username)return e.showToast({title:"请输入账号",icon:"none"}),!1;if(!this.form.password)return e.showToast({title:"请输入密码",icon:"none"}),!1;this.checked?(e.setStorageSync("password",this.form.password),e.setStorageSync("username",this.form.username)):(e.removeStorageSync("username"),e.removeStorageSync("password")),this.isButtonDisabled=!0,this.userLoginFn()}else this.show=!0},confirm:function(){this.show=!1,this.radio=!0},userLoginFn:function(){var n=this;return(0,u.default)(o.default.mark((function t(){var r,u;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return setTimeout((function(){n.isButtonDisabled=!1}),500),t.next=3,n.$u.api.userLogin({username:n.form.username,password:s.Base64.encode(n.form.password.toString())});case 3:return r=t.sent,console.log(r),e.setStorageSync("token",r.data.token),t.next=8,n.$u.api.getUserInfo();case 8:u=t.sent,n.$u.vuex("userRoles",u.data.roles),n.$u.route({type:"reLaunch",url:"/pages/tabbar/index/index"});case 11:case"end":return t.stop()}}),t)})))()},goPage:function(e){switch(e){case"1":this.$u.route("/pages/agreement/agreement",{type:"1"});break;case"2":this.$u.route("/pages/agreement/agreement",{type:"2"});break;default:console.log("Unknown fruit");break}}}};n.default=i}).call(this,t(2)["default"])},97:function(e,n,t){"use strict";t.r(n);var r=t(98),o=t.n(r);for(var u in r)["default"].indexOf(u)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(u);n["default"]=o.a},98:function(e,n,t){}},[[86,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/login.js.map