webpackJsonp([44],{"6JCT":function(n,e,i){(e=i("yGwj")(!0)).push([n.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","",{version:3,sources:[],names:[],mappings:"",file:"ReBindingMail.vue"}]),n.exports=e},WL6l:function(n,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=i("SQ4B"),r=i("vGYV"),t=i("qI5z"),o=i("2uFj"),s={name:"ReBindingMail",data:function(){return{active:0,user:{},loading:!1,emailBindingForm:{email:"",verifyCode:""},hasVerifyCode:!1,codeTime:60,rules:{verifyCode:[{required:!0,message:"请输入验证码",trigger:"blur"},{min:6,max:6,message:"验证码长度为6个字符",trigger:"blur"}],email:[{required:!0,message:"请输入邮箱",trigger:"blur"},{validator:function(n,e,i){e?/^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/.test(e)?i():i(new Error("请输入正确的邮箱格式,注意去掉前后的空格")):i()},trigger:"blur"}]}}},methods:{setUserInfo:function(){var n=this,e=Object(r.M)("user")&&Object(r.M)("user").userVO.id;a.a.get("/api/user/"+e).then(function(e){n.user=e.userVO})},reBindingMail:function(){var n=this;this.showLoading();var e={id:this.user.id,email:this.emailBindingForm.email,verifyCode:this.emailBindingForm.verifyCode};a.a.put("/api/user/email",e).then(function(e){n.hideLoading(),"ERROR"==e.msg?(Object(t.a)("error","绑定失败:"+e.data),n.codeTime=60,n.hasVerifyCode=!1):(window.alert("邮箱修改成功, 请重新登录"),Object(r.G)().then(function(n){window.location.href=o.b}))})},getVerifyCode:function(){var n=this,e={id:this.user.id,email:this.emailBindingForm.email};a.a.put("/api/verify/email",e).then(function(e){var i=n;if("ERROR"==e.msg)Object(t.a)("error","验证码获取失败:"+e.data);else{n.hasVerifyCode=!0,Object(t.a)("success",e.data);var a=setInterval(function(){i.codeTime>0?i.codeTime--:(clearInterval(a),i.hasVerifyCode=!1,this.codeTime=10)},1e3)}}).catch(function(n){Object(t.a)("error","获取验证码失败:"+n.data)})},showLoading:function(){this.loading=!0},hideLoading:function(){this.loading=!1}},mounted:function(){this.setUserInfo()}},l=function(){var n=this,e=n.$createElement,i=n._self._c||e;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:n.loading,expression:"loading"}]},[i("el-form",{ref:n.emailBindingForm,staticStyle:{width:"400px"},attrs:{"label-width":"80px",rules:n.rules,model:n.emailBindingForm}},[i("el-form-item",{attrs:{label:"新邮箱号",prop:"email"}},[i("el-input",{model:{value:n.emailBindingForm.email,callback:function(e){n.$set(n.emailBindingForm,"email",e)},expression:"emailBindingForm.email"}})],1),n._v(" "),i("el-form-item",{attrs:{label:"验证码",prop:"verifyCode"}},[i("el-input",{staticClass:"input-with-select",attrs:{placeholder:"验证码内容"},model:{value:n.emailBindingForm.verifyCode,callback:function(e){n.$set(n.emailBindingForm,"verifyCode",e)},expression:"emailBindingForm.verifyCode"}},[i("el-button",{attrs:{slot:"append",disabled:n.hasVerifyCode},on:{click:n.getVerifyCode},slot:"append"},[n._v(n._s(n.hasVerifyCode?n.codeTime:"获取验证码"))])],1),n._v(" "),n.hasVerifyCode?i("span",[n._v("验证码已发送到您邮箱上")]):n._e()],1),n._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary",plain:""},on:{click:n.reBindingMail}},[n._v("完成绑定")])],1)],1)],1)};l._withStripped=!0;var d={render:l,staticRenderFns:[]},m=d;var c=!1;var u=i("VU/8")(s,m,!1,function(n){c||i("lrfj")},"data-v-151f515e",null);u.options.__file="src/pages/UserCenter/ReBindingMail.vue";e.default=u.exports},lrfj:function(n,e,i){var a=i("6JCT");"string"==typeof a&&(a=[[n.i,a,""]]),a.locals&&(n.exports=a.locals);i("rjj0")("d358bcbc",a,!1,{})}});