(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b0419900"],{"5fa2":function(e,t,n){"use strict";var r=n("f0e1"),a=n.n(r);a.a},7103:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("a-form-model",{ref:"form",attrs:{model:e.model,rules:e.validatorRules}},[n("a-form-model-item",{attrs:{required:"",prop:"mobile"}},[n("a-input",{attrs:{size:"large",type:"text",placeholder:"请输入手机号"},model:{value:e.model.mobile,callback:function(t){e.$set(e.model,"mobile",t)},expression:"model.mobile"}},[n("a-icon",{style:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"mobile"},slot:"prefix"})],1)],1),n("a-row",{attrs:{gutter:16}},[n("a-col",{staticClass:"gutter-row",attrs:{span:16}},[n("a-form-model-item",{attrs:{required:"",prop:"captcha"}},[n("a-input",{attrs:{size:"large",type:"text",placeholder:"请输入验证码"},model:{value:e.model.captcha,callback:function(t){e.$set(e.model,"captcha",t)},expression:"model.captcha"}},[n("a-icon",{style:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"mail"},slot:"prefix"})],1)],1)],1),n("a-col",{staticClass:"gutter-row",attrs:{span:8}},[n("a-button",{staticClass:"getCaptcha",attrs:{tabindex:"-1",disabled:e.state.smsSendBtn},domProps:{textContent:e._s(e.state.smsSendBtn?e.state.time+" s":"获取验证码")},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.getCaptcha(t)}}})],1)],1)],1)],1)},a=[],o=n("0fea"),i=n("2f62");function s(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=l(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function l(e,t){if(e){if("string"===typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d={name:"LoginPhone",data:function(){return{model:{mobile:"",captcha:""},state:{time:60,smsSendBtn:!1},validatorRules:{mobile:[{required:!0,message:"请输入手机号码!"},{validator:this.validateMobile}],captcha:[{required:!0,message:"请输入验证码!"}]}}},methods:f(f({},Object(i["b"])(["PhoneLogin"])),{},{handleLogin:function(e){var t=this;this.validateFields(["mobile","captcha"],(function(n){if(n)t.$emit("validateFail");else{var r={mobile:t.model.mobile,captcha:t.model.captcha,remember_me:e};t.PhoneLogin(r).then((function(e){t.$emit("success",e.result)})).catch((function(e){t.$emit("fail",e)}))}}))},validateMobile:function(e,t,n){!t||new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(t)?n():n("您的手机号码格式不正确!")},getCaptcha:function(e){e.preventDefault();var t=this;t.validateFields(["mobile"],(function(e){if(!e){t.state.smsSendBtn=!0;var n=window.setInterval((function(){t.state.time--<=0&&(t.state.time=60,t.state.smsSendBtn=!1,window.clearInterval(n))}),1e3),r=t.$message.loading("验证码发送中..",0),a={};a.mobile=t.model.mobile,a.smsmode="0",Object(o["i"])("/sys/sms",a).then((function(e){e.success||(setTimeout(r,0),t.cmsFailed(e.message)),setTimeout(r,500)})).catch((function(e){setTimeout(r,1),clearInterval(n),t.state.time=60,t.state.smsSendBtn=!1,t.requestFailed(e)}))}}))},cmsFailed:function(e){this.$notification["error"]({message:"获取验证码失败",description:e,duration:4})},validateFields:function(e,t){var n,r=this,a=[],o=s(e);try{var i=function(){var e=n.value,t=new Promise((function(t,n){r.$refs["form"].validateField(e,(function(e){e?n(e):t()}))}));a.push(t)};for(o.s();!(n=o.n()).done;)i()}catch(l){o.e(l)}finally{o.f()}Promise.all(a).then((function(){t()})).catch((function(e){t(e)}))}})},p=d,b=(n("5fa2"),n("2877")),h=Object(b["a"])(p,r,a,!1,null,"994311e4",null);t["default"]=h.exports},f0e1:function(e,t,n){}}]);
|