login.js 4.4 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/user/login/login"],{"164e":function(n,e,o){"use strict";o.r(e);var t=o("84f4"),u=o("82a3");for(var i in u)"default"!==i&&function(n){o.d(e,n,(function(){return u[n]}))}(i);o("f9b5");var r,c=o("f0c5"),a=Object(c["a"])(u["default"],t["b"],t["c"],!1,null,"027856c4",null,!1,t["a"],r);e["default"]=a.exports},"1b8b":function(n,e,o){},"81ce":function(n,e,o){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,u=i(o("a34a"));function i(n){return n&&n.__esModule?n:{default:n}}function r(n,e,o,t,u,i,r){try{var c=n[i](r),a=c.value}catch(s){return void o(s)}c.done?e(a):Promise.resolve(a).then(t,u)}function c(n){return function(){var e=this,o=arguments;return new Promise((function(t,u){var i=n.apply(e,o);function c(n){r(i,t,u,c,a,"next",n)}function a(n){r(i,t,u,c,a,"throw",n)}c(void 0)}))}}var a={data:function(){return{loginByWeixinModalShow:!1,data:{},form1:{username:"",password:""},rules:{username:[{required:!0,message:"请输入账号",trigger:"blur,change"}],password:[{min:6,message:"密码不能少于6个字符",trigger:"change"}]},scrollTop:0}},onPageScroll:function(n){this.scrollTop=n.scrollTop},onLoad:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=this,t.options=n,t.init(n)},onReady:function(){this.$refs.uForm.setRules(this.rules)},onShareAppMessage:function(n){},methods:{getPhoneNumber:function(e){var o=e.detail||{},t=this;n.login({success:function(e){e.code?n.api.base.apiwxlogin({code:e.code,phone_code:o.code,iv:o.iv,encrypted_data:o.encryptedData}).then((function(e){n.setStorageSync("MD_token",e.token),n.setStorageSync("MD_userInfo",e),n.setStorageSync("MD_phone",e.phone),n.$msg("登录成功~"),t.getUserInfo()})).catch((function(n){console.log(n)})):console.log("登录失败!"+e.errMsg)}})},init:function(){var e=arguments,o=this;return c(u.default.mark((function t(){var i;return u.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.length>0&&void 0!==e[0]?e[0]:{},i=n.getStorageSync("MD_phone"),o.form1.username=i;case 3:case"end":return t.stop()}}),t)})))()},loginHandle:function(){var e=this,o=this;this.$refs.uForm.validate((function(t){t?n.api.base.apilogin({phone:e.form1.username,password:e.form1.password}).then((function(e){n.setStorageSync("MD_userInfo",e),n.setStorageSync("MD_phone",e.phone),n.setStorageSync("MD_token",e.token),n.$msg("登录成功~"),console.log(o),o.getUserInfo()})):console.log("验证失败")}))},getUserInfo:function(){n.api.base.apiuserinfo().then((function(e){n.setStorageSync("MD_userInfo2",e),n.reLaunch({url:"/pages/index/index"})}))},loginByWeixin:function(){}},watch:{},computed:{}};e.default=a}).call(this,o("543d")["default"])},"82a3":function(n,e,o){"use strict";o.r(e);var t=o("81ce"),u=o.n(t);for(var i in t)"default"!==i&&function(n){o.d(e,n,(function(){return t[n]}))}(i);e["default"]=u.a},"84f4":function(n,e,o){"use strict";o.d(e,"b",(function(){return u})),o.d(e,"c",(function(){return i})),o.d(e,"a",(function(){return t}));var t={uAvatar:function(){return o.e("uni_modules/vk-uview-ui/components/u-avatar/u-avatar").then(o.bind(null,"2143"))},uForm:function(){return o.e("uni_modules/vk-uview-ui/components/u-form/u-form").then(o.bind(null,"ce96"))},uFormItem:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/vk-uview-ui/components/u-form-item/u-form-item")]).then(o.bind(null,"23cb"))},uInput:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/vk-uview-ui/components/u-input/u-input")]).then(o.bind(null,"6943"))},uGap:function(){return o.e("uni_modules/vk-uview-ui/components/u-gap/u-gap").then(o.bind(null,"dc7f"))},uButton:function(){return o.e("uni_modules/vk-uview-ui/components/u-button/u-button").then(o.bind(null,"ce9e"))},uLine:function(){return o.e("uni_modules/vk-uview-ui/components/u-line/u-line").then(o.bind(null,"a2cb"))},uIcon:function(){return o.e("uni_modules/vk-uview-ui/components/u-icon/u-icon").then(o.bind(null,"ba35"))},uModal:function(){return o.e("uni_modules/vk-uview-ui/components/u-modal/u-modal").then(o.bind(null,"f813"))}},u=function(){var n=this,e=n.$createElement;n._self._c},i=[]},f1c3:function(n,e,o){"use strict";(function(n){o("3690");t(o("66fd"));var e=t(o("164e"));function t(n){return n&&n.__esModule?n:{default:n}}wx.__webpack_require_UNI_MP_PLUGIN__=o,n(e.default)}).call(this,o("543d")["createPage"])},f9b5:function(n,e,o){"use strict";var t=o("1b8b"),u=o.n(t);u.a}},[["f1c3","common/runtime","common/vendor"]]]);