You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jiaojiu/dist/js/chunk-315f5c4a.c64363f3.js

2 lines
5.1 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-315f5c4a"],{"10a1":function(e,t,r){},"1eaa":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"login_container"},[n("div",{staticClass:"top"},[n("div",{staticClass:"back",on:{click:e.backClick}},[n("img",{attrs:{src:r("5aa0"),alt:""}})]),n("span",[e._v("短信登录")]),e._m(0)]),n("div",{staticClass:"login_box"},[n("el-form",{ref:"verifyFormRef",staticClass:"login_form",attrs:{"label-width":"0px",model:e.verifyForm,rules:e.verifyFormRules}},[n("el-form-item",{attrs:{prop:"iphone"}},[n("el-input",{ref:"iphoneFormRef",attrs:{placeholder:"请输入手机号","prefix-icon":"el-icon-phone"},model:{value:e.verifyForm.iphone,callback:function(t){e.$set(e.verifyForm,"iphone",t)},expression:"verifyForm.iphone"}})],1),n("el-form-item",{staticClass:"verify",attrs:{prop:"code"}},[n("el-input",{staticClass:"verifyMessage",attrs:{placeholder:"请输入验证码","prefix-icon":"el-icon-s-goods"},model:{value:e.verifyForm.code,callback:function(t){e.$set(e.verifyForm,"code",t)},expression:"verifyForm.code"}}),n("el-button",{staticClass:"getVerify",on:{click:e.emitsmsverify}},[e._v("验证码")])],1),n("el-form-item",[n("el-row",[n("el-button",{staticClass:"btns-login",attrs:{type:"primary"},on:{click:e.login}},[e._v("登陆")])],1)],1)],1)],1)])},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("img",{staticClass:"logo",attrs:{src:r("8138"),alt:""}}),n("div",{staticClass:"icon"},[e._v("交 酒")])])}],o=(r("b0c0"),r("d3b7"),r("3ca3"),r("ddb0"),r("2b3d"),r("96cf"),r("1da1")),s={name:"Iphone",components:{},data:function(){var e=this,t=function(t,r,n){""===r?n(new Error("请输入手机号")):e.isCellPhone(r)?n():n(new Error("请输入正确的手机号!"))};return{verifyForm:{iphone:"",code:""},verifyFormRules:{iphone:[{required:!0,message:"请输入电话号码",trigger:"blur"},{validator:t,trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"},{min:6,max:6,message:"验证码为6位",trigger:"blur"}]}}},methods:{emitsmsverify:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$refs.verifyFormRef.validateField("iphone",function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=2;break}return t.abrupt("return");case 2:return e.emitsms(),n=new URLSearchParams,n.append("iphone",e.verifyForm.iphone),t.prev=5,t.next=8,e.$http({method:"post",url:"/sms/get",data:n});case 8:e.$message.success("发送成功"),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](5);case 14:case"end":return t.stop()}}),t,null,[[5,11]])})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()},emitsms:function(){var e,t=document.getElementsByClassName("getVerify")[0];t.setAttribute("disabled",!0);var r=window.sessionStorage.getItem("time");e=0==r||null==r?60:r;var n=setInterval((function(){e>=0?(t.style.color="#606266",t.style.borderColor="#DCDFE6",t.style.backgroundColor="#FFF",t.innerHTML=e--+"秒",window.sessionStorage.setItem("time",e+1)):(clearInterval(n),t.disabled=!1,t.style.color="#fff",t.style.borderColor="#df3832",t.style.backgroundColor="#df3832",t.innerHTML="验证码")}),1e3)},isCellPhone:function(e){return!!/^1(3|4|5|6|7|8|9)\d{9}$/.test(e)},backClick:function(){this.$router.push("/login")},login:function(){var e=this;this.$refs.verifyFormRef.validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(r){var n,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,e.$http.post("/sms/login",e.verifyForm);case 5:n=t.sent,i=n.data,e.$message.success("如果第一次登录手机登录,默认密码为手机号"),window.localStorage.setItem("token",i.token),window.localStorage.setItem("userId",i.id),window.localStorage.setItem("name",i.name),window.localStorage.setItem("ispraise","1"),window.localStorage.setItem("number","0"),e.$refs.verifyFormRef.resetFields(),e.$bus.$emit("isallrefreshInfo"),e.$router.push("/home"),t.next=21;break;case 18:t.prev=18,t.t0=t["catch"](2),e.$message.error("登录失败");case 21:case"end":return t.stop()}}),t,null,[[2,18]])})));return function(e){return t.apply(this,arguments)}}())}},mounted:function(){var e=this;window.onresize=function(){return function(){e.showHeight=document.body.clientHeight}()};var t=window.sessionStorage.getItem("time");0==t||null==t||this.emitsms()}},a=s,c=(r("e537"),r("2877")),l=Object(c["a"])(a,n,i,!1,null,"2d99e81f",null);t["default"]=l.exports},b0c0:function(e,t,r){var n=r("83ab"),i=r("9bf2").f,o=Function.prototype,s=o.toString,a=/^\s*function ([^ (]*)/,c="name";n&&!(c in o)&&i(o,c,{configurable:!0,get:function(){try{return s.call(this).match(a)[1]}catch(e){return""}}})},e537:function(e,t,r){"use strict";var n=r("10a1"),i=r.n(n);i.a}}]);
//# sourceMappingURL=chunk-315f5c4a.c64363f3.js.map