(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/login/login"],{"2edd":function(n,t,e){"use strict";e.r(t);var o=e("66c7"),i=e("37f5");for(var u in i)"default"!==u&&function(n){e.d(t,n,(function(){return i[n]}))}(u);e("aad8");var c,r=e("f0c5"),s=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],c);t["default"]=s.exports},"37f5":function(n,t,e){"use strict";e.r(t);var o=e("ee6b"),i=e.n(o);for(var u in o)"default"!==u&&function(n){e.d(t,n,(function(){return o[n]}))}(u);t["default"]=i.a},4092:function(n,t,e){},"66c7":function(n,t,e){"use strict";e.d(t,"b",(function(){return i})),e.d(t,"c",(function(){return u})),e.d(t,"a",(function(){return o}));var o={uModal:function(){return e.e("node-modules/uview-ui/components/u-modal/u-modal").then(e.bind(null,"e57a"))},uForm:function(){return e.e("node-modules/uview-ui/components/u-form/u-form").then(e.bind(null,"459a"))},uFormItem:function(){return Promise.all([e.e("common/vendor"),e.e("node-modules/uview-ui/components/u-form-item/u-form-item")]).then(e.bind(null,"5690"))},uInput:function(){return Promise.all([e.e("common/vendor"),e.e("node-modules/uview-ui/components/u-input/u-input")]).then(e.bind(null,"1c95"))},uCheckbox:function(){return e.e("node-modules/uview-ui/components/u-checkbox/u-checkbox").then(e.bind(null,"1484"))}},i=function(){var n=this,t=n.$createElement;n._self._c;n._isMounted||(n.e0=function(t){n.pswShow=!0},n.e1=function(t){n.cur=0})},u=[]},aad8:function(n,t,e){"use strict";var o=e("4092"),i=e.n(o);i.a},bdd1:function(n,t,e){"use strict";(function(n){e("4481");o(e("66fd"));var t=o(e("2edd"));function o(n){return n&&n.__esModule?n:{default:n}}n(t.default)}).call(this,e("543d")["createPage"])},ee6b:function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(e("a34a"));function i(n){return n&&n.__esModule?n:{default:n}}function u(n,t,e,o,i,u,c){try{var r=n[u](c),s=r.value}catch(a){return void e(a)}r.done?t(s):Promise.resolve(s).then(o,i)}function c(n){return function(){var t=this,e=arguments;return new Promise((function(o,i){var c=n.apply(t,e);function r(n){u(c,o,i,r,s,"next",n)}function s(n){u(c,o,i,r,s,"throw",n)}r(void 0)}))}}var r={data:function(){return{isSave:!1,show:!1,content:"",phone:"",pwd:"",tipShow:!1,pswShow:!1,newPsw:"",confirmPsw:""}},onLoad:function(){var t=this;n.getStorage({key:"account",success:function(n){t.phone=n.data.account,t.pwd=n.data.pwd,t.isSave=!0}})},methods:{checkboxChange:function(n){this.isSave=n.value},handelLogin:function(){var t=this;return c(o.default.mark((function e(){var i,u;return o.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t,e.next=3,t.$api.getCurrentAccount();case 3:u=e.sent,1==u.data.hadUpdatePwd?(1==t.isSave?n.setStorageSync("account",{account:i.phone,pwd:i.pwd}):n.removeStorageSync("account"),n.reLaunch({url:"../index/index"})):t.tipShow=!0;case 5:case"end":return e.stop()}}),e)})))()},changeConfirm:function(){var t=this;if(this.$isEmpty(this.newPsw))return this.$u.toast("新密码不能为空"),void(this.pswShow=!0);if(this.$isEmpty(this.confirmPsw))return this.pswShow=!0,void this.$u.toast("确认密码不能为空");if(this.pwd===this.newPsw)return this.pswShow=!0,void this.$u.toast("新密码不能和旧密码一致");if(this.newPsw!==this.confirmPsw)return this.pswShow=!0,void this.$u.toast("两次输入的密码不一致");var e={oldPwd:this.pwd,newPwd:this.newPsw,confirmPwd:this.confirmPsw};this.$api.updatePsw(e).then((function(e){"success"==e.msg&&(n.showToast({title:"修改成功，请重新登录",icon:"none",duration:2e3}),t.pwd="")}))},login:function(){var t=this,e=this;return e.phone?e.pwd?(this.$dialog.showLoading("登录中..."),void this.$api.permissions.login({loginName:e.phone,loginPwd:e.pwd},{"Content-Type":"application/x-www-form-urlencoded"}).then((function(o){"200"==o.code?(n.setStorageSync("access-token",o.data),t.handelLogin()):(e.content=o.msg,e.show=!0),n.hideLoading()})).catch((function(t){n.hideLoading()}))):(e.content="请输入您的密码",void(e.show=!0)):(e.content="请输入您的账号",void(e.show=!0))}}};t.default=r}).call(this,e("543d")["default"])}},[["bdd1","common/runtime","common/vendor"]]]);