-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccount.4c8daee2.js
1 lines (1 loc) · 14 KB
/
account.4c8daee2.js
1
var e=Object.defineProperty,t=(t,o,l)=>(((t,o,l)=>{o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[o]=l})(t,"symbol"!=typeof o?o+"":o,l),l);import{E as o,a as l,e as i,b as s}from"./e404.f67fe263.js";import{V as r,a,r as d,_ as n,b as h,R as m,d as c,o as p,g as f,j as u,k as g}from"./vendor.aebc7018.js";import{l as b}from"./logo.a02c35c7.js";var w="_login_1ij68_1",v="_form_1ij68_9",y="_div_1ij68_15",x="_loginbtn_1ij68_57";class V extends r{constructor(){super(...arguments),t(this,"form",{}),t(this,"fromRef"),t(this,"regform",{}),t(this,"regformRef"),t(this,"logintype",1),t(this,"imgcode",null),t(this,"imgcodeshow",!1),t(this,"imgcodeinput",null),t(this,"loading",!1),t(this,"time",0),t(this,"tabindex","login"),t(this,"tool",!1),t(this,"loginloading",!1),t(this,"regloading",!1),t(this,"loginErr",{}),t(this,"redirect",null)}mounted(){setTimeout((()=>{this.tool=!0}),500)}render(){return a("div",{style:{backgroundImage:"url(./assets/login.ba00ac86.png)"},class:w},[a("div",{class:"mt-6 ml-6 d-flex align-end"},[a(d("el-image"),{src:b,lazy:!0},null),a("span",{class:"orange--text font-size-4 ml-3 font-weight-bold"},[c("线上综合服务平台")])]),a("div",{class:[v,"d-flex align-center"]},[a("div",{class:[y,"rounded white"]},[a(d("el-tabs"),{stretch:!0,modelValue:this.tabindex,"onUpdate:modelValue":e=>this.tabindex=e,"onTab-click":()=>{this.tool="login"==this.tabindex}},{default:()=>[a(d("el-tab-pane"),{name:"login"},{label:()=>a("span",{class:"font-size-4 font-weight-bold"},[c("登录")]),default:()=>a("div",{class:"pa-15 pt-0"},[a("div",{class:"d-flex py-4 align-center"},[a("div",{class:" flex-grow-1 font-size-4 font-weight-bold"},[1==this.logintype?"密码登录":"短信验证码登录"]),a(d("el-popover"),{width:"100px",content:1==this.logintype?"短信验证码登录":"密码登录",placement:"left",trigger:"manual",visible:this.tool,"onUpdate:visible":e=>this.tool=e},{reference:()=>a("i",{style:{cursor:"pointer"},onClick:()=>{this.tool=!0,1==this.logintype?this.logintype=2:this.logintype=1},class:["user-iconfont font-size-11 grey--text",1==this.logintype?"icon-msgcode":"icon-web"]},null)})]),a(d("el-form"),{ref:"fromRef",model:this.form,"label-position":"top"},{default:()=>[a(d("el-form-item"),{prop:"phone",error:this.loginErr.phone,label:"手机号码:",rules:[o.phone("手机号不正确")]},{default:()=>[a(d("el-input"),{placeholder:"手机号码",autocomplete:"off",clearable:!0,modelValue:this.form.phone,"onUpdate:modelValue":e=>this.form.phone=e},null)]}),a(d("v-if"),{show:1==this.logintype},{default:()=>[a(d("el-form-item"),{prop:"password",label:"登录密码:",error:this.loginErr.password,rules:[o.password("密码格式错误")]},{default:()=>[a(d("el-input"),{placeholder:"密码",autocomplete:"off",clearable:!0,type:"password",modelValue:this.form.password,"onUpdate:modelValue":e=>this.form.password=e},null)]})]}),a(d("v-if"),{show:2==this.logintype},{default:()=>[a(d("el-form-item"),{label:"验证码:",error:this.loginErr.code,rules:[o.length("请输入6位验证码",6)]},{default:()=>[a("div",{class:"d-flex flex-row"},[a(d("el-input"),{modelValue:this.form.code,"onUpdate:modelValue":e=>this.form.code=e,placeholder:"验证码",autocomplete:"off",clearable:!0},null),a(d("el-button"),{disabled:0!=this.time||!this.form.phone||null!=p.phone(this.form.phone),class:"ml-3",onClick:()=>{this.getimgcode(!0)}},{default:()=>[0!=this.time?this.time+"秒后可重新获取":"获取验证码"]})])]})]}),a("div",{class:"text-right"},[a(d("router-link"),{to:{name:"pwd"}},{default:()=>[c("忘记密码?")]})]),a("div",{class:[x,"mt-6"]},[a(d("el-button"),{type:"primary",round:!0,class:"rounded-xl",onClick:this.submitForm,loading:this.loginloading},{default:()=>[a("span",{class:"font-size-4"},[c("登 录")])]})])]})])}),a(d("el-tab-pane"),{name:"reg"},{label:()=>a("span",{class:"font-size-4 font-weight-bold"},[c("注册")]),default:()=>a("div",{class:"pa-15 pt-0"},[a("div",{class:" py-4 font-size-4 font-weight-bold"},[c("新用户注册")]),a(d("el-form"),{ref:"regformRef",model:this.regform,"label-position":"top"},{default:()=>[a(d("el-form-item"),{prop:"phone",label:"手机号码:",rules:[o.notBlank("手机号不能为空"),o.phone("手机号不正确")]},{default:()=>[a(d("el-input"),{placeholder:"手机号码",autocomplete:"off",clearable:!0,modelValue:this.regform.phone,"onUpdate:modelValue":e=>this.regform.phone=e},null)]}),a(d("el-form-item"),{prop:"code",label:"验证码:",rules:[o.notBlank("验证码不能为空")]},{default:()=>[a("div",{class:"d-flex flex-row"},[a(d("el-input"),{modelValue:this.regform.code,"onUpdate:modelValue":e=>this.regform.code=e,placeholder:"验证码",autocomplete:"off",clearable:!0},null),a(d("el-button"),{disabled:0!=this.time||!this.regform.phone||null!=p.phone(this.regform.phone),class:"ml-3",onClick:()=>{this.getimgcode(!0)}},{default:()=>[0!=this.time?this.time+"秒后可重新获取":"获取验证码"]})])]}),a(d("el-form-item"),{prop:"password",label:"登录密码:",rules:[o.notBlank("密码不能为空")]},{default:()=>[a(d("el-input"),{placeholder:"密码",autocomplete:"off",clearable:!0,type:"password",modelValue:this.regform.password,"onUpdate:modelValue":e=>this.regform.password=e},null)]}),a(d("el-form-item"),{prop:"password",label:"确认密码:",rules:[o.notBlank("密码不能为空"),o.equals("两次输入的密码不一致",this.regform.password)]},{default:()=>[a(d("el-input"),{placeholder:"密码",autocomplete:"off",clearable:!0,type:"password",modelValue:this.regform.relpwd,"onUpdate:modelValue":e=>this.regform.relpwd=e},null)]}),a("div",{class:[x,"mt-8"]},[a(d("el-button"),{type:"primary",round:!0,class:"rounded-xl",onClick:this.submitRegForm,loading:this.regloading},{default:()=>[a("span",{class:"font-size-4"},[c("确 认")])]})])]})])})]})])]),a(d("el-dialog"),{modelValue:this.imgcodeshow,"onUpdate:modelValue":e=>this.imgcodeshow=e,title:"获取短信验证码",width:"400px"},{default:()=>[a("div",null,[a("div",{class:"d-flex flex-row align-center"},[a(d("el-input"),{modelValue:this.imgcodeinput,"onUpdate:modelValue":e=>this.imgcodeinput=e},null),a(d("el-image"),{style:{width:"150px",height:"40px"},class:"ml-2",src:this.imgcode,onClick:()=>this.getimgcode()},{error:()=>a("div",{class:"grey--text",onClick:()=>this.getimgcode()},[c("点击刷新")])})]),a("div",{class:"d-flex flex-row mt-3 justify-center"},[a(d("el-button"),{type:"primary",onClick:this.getmsgcode,loading:this.loading},{default:()=>[c("确定")]}),a(d("el-button"),{onClick:()=>this.imgcodeshow=!1},{default:()=>[c("取消")]})])])]})])}created(){var e,t,o,l,i,s;this.redirect=this.$route.query.redirect,this.redirect&&localStorage.setItem("loginRedirect",this.redirect),!this.redirect&&"true"==this.$route.query.back&&localStorage.getItem("loginRedirect")?this.redirect=localStorage.getItem("loginRedirect"):this.redirect&&(null==(e=this.redirect)?void 0:e.includes("http://"))&&!(null==(t=this.redirect)?void 0:t.includes("https://"))&&((null==(o=this.redirect)?void 0:o.includes("/shop"))||(null==(l=this.redirect)?void 0:l.includes("admin."))||(null==(i=this.redirect)?void 0:i.includes("ceb.")))?(null==(s=this.redirect)?void 0:s.includes("ceb."))&&(this.redirect="//ceb.lygddt.com/"):this.redirect="//lygddt.com/shop",this.autoLogin()}submitForm(){this.fromRef.validate((e=>{e&&(this.loginErr={},this.loginloading=!0,this.$axios.patch(2==this.logintype?"/login/code":"/login",this.form,{params:{redirect:this.redirect}}).then((e=>{location.href=e,localStorage.removeItem("loginRedirect")})).catch((e=>{this.$message.error(e.message||"登录失败"),e.data&&(this.loginErr=e.data)})).finally((()=>this.loginloading=!1)))}))}autoLogin(){this.$axios.get("/login",{params:{redirect:this.redirect}}).then((e=>{location.href=e,localStorage.removeItem("loginRedirect")}))}getimgcode(e=!1){this.imgcode="//account.lygddt.com/api/other/img/code?i="+Math.random(),e&&(this.imgcodeshow=!0)}getmsgcode(){if(!this.imgcodeinput)return this.$message.error("请输入图形码");this.loading=!0;let e=null;e="login"==this.tabindex?this.$axios.post("/other/login/code",{code:this.imgcodeinput,phone:this.form.phone}):this.$axios.post("/other/reg/code",{code:this.imgcodeinput,phone:this.regform.phone}),e.then((e=>{this.$message.success("发送成功,请主要查收短信"),this.imgcodeshow=!1,this.start(120)})).catch((e=>{this.$message.error((null==e?void 0:e.message)||"短信发送失败,请刷新后重试")})).finally((()=>this.loading=!1))}start(e){this.time=e,e>0&&setTimeout((()=>{this.start(e-1)}),1e3)}submitRegForm(){this.regformRef.validate((e=>{e&&(this.regloading=!0,this.$axios.post("/login/reg",this.regform).then((e=>{this.$message.success("注册成功"),this.tabindex="login"})).catch((e=>{this.$message.error(e.message||"注册失败")})).finally((()=>this.regloading=!1)))}))}}h([m("fromRef")],V.prototype,"fromRef",void 0),h([m("regformRef")],V.prototype,"regformRef",void 0);var _="_pwd_1lstz_1",k="_form_1lstz_9",R="_div_1lstz_12",z="_bBorder_1lstz_17",$="_pwdbtn_1lstz_20",U="_cont_1lstz_24";class E extends r{constructor(){super(...arguments),t(this,"form",{}),t(this,"fromRef"),t(this,"formErr",{}),t(this,"loading",!1),t(this,"time",0),t(this,"imgcode",null),t(this,"isindex",1)}render(){return a("div",{style:{backgroundImage:"url(./assets/pwd-bg.a393d707.png)"},class:_},[a("div",{class:"mt-6 ml-6 d-flex align-end"},[a(d("el-image"),{src:"./assets/logo.e2977a51.svg",lazy:!0,style:"width:480px"},null),a("span",{class:"orange--text font-size-3 ml-3"},[c("线上综合服务平台")])]),a("div",{class:[k,"d-flex justify-center"]},[a("div",{class:[R,"rounded white"]},[a("div",{class:[" pa-7",z]},[a("span",{class:"font-size-4 font-weight-bold"},[c("忘记密码")]),a("span",{class:"font-size-2"},[c("(1.注册手机号码验证 2.重置密码)")])]),a("div",{class:U},[a(d("el-form"),{ref:"fromRef",model:this.form,"label-position":"top"},{default:()=>[a(d("v-if"),{show:1==this.isindex},{default:()=>[a(d("el-form-item"),{prop:"phone",error:this.formErr.phone,label:"手机号码:",rules:[o.notBlank("输入手机号码"),o.phone("手机号不正确")]},{default:()=>[a(d("el-input"),{placeholder:"请填写注册手机号码",autocomplete:"off",clearable:!0,modelValue:this.form.phone,"onUpdate:modelValue":e=>this.form.phone=e},null)]}),a(d("el-form-item"),{label:"图形验证码:",error:this.formErr.imgcode,prop:"imgcode",rules:[o.notBlank("输入图形验证码")]},{default:()=>[a("div",{class:"d-flex flex-row align-center"},[a(d("el-input"),{modelValue:this.form.imgcode,"onUpdate:modelValue":e=>this.form.imgcode=e,placeholder:"输入图形验证码"},null),a(d("el-image"),{style:{width:"150px",height:"40px"},class:"ml-2",src:this.imgcode,onClick:()=>this.getimgcode()},{error:()=>a("div",{class:"grey--text",onClick:()=>this.getimgcode()},[c("点击刷新")])})])]})]}),a(d("v-if"),{show:1!=this.isindex},{default:()=>[a(d("el-form-item"),{prop:"phone",label:"手机验证码:",error:this.formErr.code,rules:[o.notBlank("请输入6位验证码")]},{default:()=>[a("div",{class:"d-flex flex-row"},[a(d("el-input"),{modelValue:this.form.code,"onUpdate:modelValue":e=>this.form.code=e,placeholder:"验证码",autocomplete:"off",clearable:!0},null),a(d("el-button"),{disabled:0!=this.time||!this.form.phone||null!=p.phone(this.form.phone),class:"ml-3",onClick:()=>{this.getimgcode()}},{default:()=>[0!=this.time?this.time+"秒后可重新获取":"获取验证码"]})])]}),a(d("el-form-item"),{prop:"password",error:this.formErr.password,label:"新密码:",rules:[o.notBlank("密码不能为空")]},{default:()=>[a(d("el-input"),{placeholder:"6到16位字母/数字/标点符号",autocomplete:"off",clearable:!0,type:"password",modelValue:this.form.password,"onUpdate:modelValue":e=>this.form.password=e},null)]}),a(d("el-form-item"),{prop:"password",label:"确认新密码:",rules:[o.notBlank("密码不能为空"),o.equals("两次输入的密码不一致",this.form.password)]},{default:()=>[a(d("el-input"),{placeholder:"6到16位字母/数字/标点符号",autocomplete:"off",clearable:!0,type:"password",modelValue:this.form.relpwd,"onUpdate:modelValue":e=>this.form.relpwd=e},null)]})]}),a("div",{class:[$,"mt-8"]},[a(d("v-if"),{show:1==this.isindex},{default:()=>[a(d("el-button"),{type:"primary",round:!0,class:"rounded-xl",onClick:this.submitForm,loading:this.loading},{default:()=>[a("span",{class:"font-size-4"},[c("下一步")])]})]}),a(d("v-if"),{show:1!=this.isindex},{default:()=>[a(d("el-button"),{type:"primary",round:!0,class:"rounded-xl",onClick:this.submitForm,loading:this.loading},{default:()=>[a("span",{class:"font-size-4"},[c("确 认")])]})]})])]})])])])])}created(){this.getimgcode()}submitForm(){this.fromRef.validate((e=>{e&&(this.formErr={},this.loading=!0,1==this.isindex?this.getmsgcode():this.$axios.patch("/login/password",this.form).then((e=>{this.$router.replace({name:"home",query:{back:"true"}})})).catch((e=>{this.$message.error(e.message||"找回密码失败"),e.data&&(this.formErr=e.data)})).finally((()=>this.loading=!1)))}))}getimgcode(){this.imgcode="//account.lygddt.com/api/other/img/code?i="+Math.random()}getmsgcode(){if(!this.form.imgcode)return this.$message.error("请输入图形码");this.$axios.post("/other/password/code",{phone:this.form.phone,code:this.form.imgcode}).then((e=>{this.$message.success("发送成功,请主要查收短信"),this.isindex=2,this.start(120)})).catch((e=>{var t,o;this.getimgcode(),this.$message.error((null==e?void 0:e.message)||"短信发送失败,请刷新后重试"),e.data&&((null==(t=e.data)?void 0:t.phone)&&(this.formErr={phone:e.data.phone}),(null==(o=e.data)?void 0:o.code)&&(this.formErr={imgcode:e.data.code}))})).finally((()=>this.loading=!1))}start(e){this.time=e,e>0&&setTimeout((()=>{this.start(e-1)}),1e3)}}h([m("fromRef")],E.prototype,"fromRef",void 0);const C=u({history:f(),routes:[{path:"/",name:"home",component:V},{path:"/pwd",name:"pwd",component:E},{path:"/502",name:"e502",props:{is502:!0},component:l},{path:"/:pathMatch(.*)*",component:l}]});g(class extends r{constructor(){super(...arguments),t(this,"name","App")}render(){return a(d("el-config-provider"),{locale:n},{default:()=>[a(d("router-view"),null,null)]})}}).use(C).use(i).use(s,{baseURL:"/api"}).mount("#app");