lcny-admin-mobile-vue/dist/build/mp-weixin/pages/login/login.js

1 line
3.3 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/login/login"],{"0036":function(e,t,n){"use strict";(function(e,t){var o=n("4ea4");n("6cdc");o(n("66fd"));var i=o(n("a86a"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},3285:function(e,t,n){"use strict";n.r(t);var o=n("8edd"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=i.a},3592:function(e,t,n){},"8edd":function(e,t,n){"use strict";(function(e){var o=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n("2eee")),a=o(n("c973")),s=(n("815d"),o(n("0cc2"))),r=o(n("8237")),u=function(){n.e("components/jp-verification-literalness/jp-verification-literalness").then(function(){return resolve(n("08d3"))}.bind(null,n)).catch(n.oe)};t.default={components:{Security:u},data:function(){return{identify:"",username:"",password:"",identifyCode:""}},onLoad:function(){this.makeCode()},methods:{randomNum:function(e,t){return Math.floor(Math.random()*(t-e)+e)},refreshCode:function(){this.identifyCode="",this.makeCode()},makeCode:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4,t="1234567890abcdef",n="",o=0;o<e;o++)n+=t[this.randomNum(0,t.length)];this.identify=n},login:function(){var t,n,o=this;if(this.username)if(this.password)if(this.identifyCode)if((null===(t=this.identifyCode)||void 0===t?void 0:t.toLowerCase())==(null===(n=this.identify)||void 0===n?void 0:n.toLowerCase())){var u={username:this.username,password:(0,r.default)(this.password),identifyCode:this.identifyCode};this.$http.post("/api/auth/login",u,{custom:{auth:!1}}).then(function(){var t=(0,a.default)(i.default.mark((function t(n){var a,r;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=n.data,console.log(a),200!=a.code){t.next=12;break}return r=a.data,r.info,console.log(r),s.default.setAccessToken(r.token),t.next=9,o.$store.dispatch("getUserInfo");case 9:e.setStorage({key:"redirect",data:"/pages/basics/profile"}),e.switchTab({url:"/pages/index/index"}),e.showToast({title:"登录成功!",icon:"none"});case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.showToast({title:t.data.message,icon:"none"})}))}else e.showToast({title:"验证码不正确",icon:"none"});else e.showToast({title:"请输入验证码",icon:"none"});else e.showToast({title:"请输入您的密码",icon:"none"});else e.showToast({title:"请输入您的账号",icon:"none"})}}}}).call(this,n("543d")["default"])},"97c6":function(e,t,n){"use strict";var o=n("3592"),i=n.n(o);i.a},a86a:function(e,t,n){"use strict";n.r(t);var o=n("eb18"),i=n("3285");for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("97c6");var s,r=n("f0c5"),u=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,"48716116",null,!1,o["a"],s);t["default"]=u.exports},eb18:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));var o={uButton:function(){return n.e("node-modules/uview-ui/components/u-button/u-button").then(n.bind(null,"d9ad"))}},i=function(){var e=this,t=e.$createElement;e._self._c},a=[]}},[["0036","common/runtime","common/vendor"]]]);