1 |
- webpackJsonp([50],{"LP+y":function(e,i){},WL6l:function(e,i,a){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=a("SQ4B"),t=a("vGYV"),n=a("qI5z"),o=a("2uFj"),l={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(e,i,a){i?/^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/.test(i)?a():a(new Error("请输入正确的邮箱格式,注意去掉前后的空格")):a()},trigger:"blur"}]}}},methods:{setUserInfo:function(){var e=this,i=Object(t.K)("user")&&Object(t.K)("user").userVO.id;r.a.get("/api/user/"+i).then(function(i){e.user=i.userVO})},reBindingMail:function(){var e=this;this.showLoading();var i={id:this.user.id,email:this.emailBindingForm.email,verifyCode:this.emailBindingForm.verifyCode};r.a.put("/api/user/email",i).then(function(i){e.hideLoading(),"ERROR"==i.msg?(Object(n.a)("error","绑定失败:"+i.data),e.codeTime=60,e.hasVerifyCode=!1):(window.alert("邮箱修改成功, 请重新登录"),Object(t.F)().then(function(e){window.location.href=o.b}))})},getVerifyCode:function(){var e=this,i={id:this.user.id,email:this.emailBindingForm.email};r.a.put("/api/verify/email",i).then(function(i){var a=e;if("ERROR"==i.msg)Object(n.a)("error","验证码获取失败:"+i.data);else{e.hasVerifyCode=!0,Object(n.a)("success",i.data);var r=setInterval(function(){a.codeTime>0?a.codeTime--:(clearInterval(r),a.hasVerifyCode=!1,this.codeTime=10)},1e3)}}).catch(function(e){Object(n.a)("error","获取验证码失败:"+e.data)})},showLoading:function(){this.loading=!0},hideLoading:function(){this.loading=!1}},mounted:function(){this.setUserInfo()}},s={render:function(){var e=this,i=e.$createElement,a=e._self._c||i;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[a("el-form",{ref:e.emailBindingForm,staticStyle:{width:"400px"},attrs:{"label-width":"80px",rules:e.rules,model:e.emailBindingForm}},[a("el-form-item",{attrs:{label:"新邮箱号",prop:"email"}},[a("el-input",{model:{value:e.emailBindingForm.email,callback:function(i){e.$set(e.emailBindingForm,"email",i)},expression:"emailBindingForm.email"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"验证码",prop:"verifyCode"}},[a("el-input",{staticClass:"input-with-select",attrs:{placeholder:"验证码内容"},model:{value:e.emailBindingForm.verifyCode,callback:function(i){e.$set(e.emailBindingForm,"verifyCode",i)},expression:"emailBindingForm.verifyCode"}},[a("el-button",{attrs:{slot:"append",disabled:e.hasVerifyCode},on:{click:e.getVerifyCode},slot:"append"},[e._v(e._s(e.hasVerifyCode?e.codeTime:"获取验证码"))])],1),e._v(" "),e.hasVerifyCode?a("span",[e._v("验证码已发送到您邮箱上")]):e._e()],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",plain:""},on:{click:e.reBindingMail}},[e._v("完成绑定")])],1)],1)],1)},staticRenderFns:[]};var d=a("VU/8")(l,s,!1,function(e){a("LP+y")},"data-v-00562b76",null);i.default=d.exports}});
|