import{H as o}from"./header.e25d2c3b.js";import{S as l,_ as n}from"./logo-gray.fc7f8dfb.js";import{n as m}from"./index.13f93d3a.js";const d={name:"find-id",components:{Header:o,SuccessDialog:l},mounted(){this.getCaptcha()},data(){return{captcha:"",captcha_key:"",showSuccess:!1,form:{data:{email:"",captcha:""},rules:{email:[{required:!0,trigger:"blur"}],captcha:[{required:!0,trigger:"blur"}]}}}},methods:{doSubmit(){const{email:a,captcha:t}=this.form.data;this.$refs.form.validate(s=>{if(s){const e=this.$t("common.failure");this.$axios.post("/api/find_id",{email:a,captcha:t,captcha_key:this.captcha_key}).then(i=>{const{code:r,msg:c=e}=i.data;r==0?this.showSuccess=!0:this.$message.error(c)}).catch(()=>{this.$message.error(e)})}})},getCaptcha(){const a=this.$t("common.failure");this.$axios.get("/api/captcha").then(t=>{const{code:s,msg:e=a,data:i}=t.data;if(s==0){const{key:r,img:c}=i;this.captcha_key=r,this.captcha=c}else this.$message.error(e)}).catch(()=>{this.$message.error(a)})},hideSuccess(a){this.showSuccess=a}},computed:{disabled(){const{email:a,captcha:t}=this.form.data;return!(a&&t)}}};var f=function(){var t=this,s=t._self._c;return s("div",{staticClass:"find-id"},[s("div",{staticClass:"find-id-content"},[t.showSuccess?s("SuccessDialog",{attrs:{title:t.$t("login.findID.success")},on:{onClose:t.hideSuccess}}):t._e(),s("Header"),s("div",{staticClass:"top"},[s("b",[t._v(t._s(t.$t("login.findID.leftTip")))])]),s("div",{staticClass:"bottom"},[s("div",{staticClass:"left"},[s("div",{staticClass:"form"},[s("el-form",{ref:"form",attrs:{model:t.form.data,rules:t.form.rules}},[s("div",{staticClass:"form-tip"},[t._v(" "+t._s(t.$t("login.findID.form.emailTip"))+" ")]),s("el-form-item",{staticClass:"email",attrs:{prop:"email"}},[s("el-input",{attrs:{placeholder:"name@naver.com",clearable:""},model:{value:t.form.data.email,callback:function(e){t.$set(t.form.data,"email",e)},expression:"form.data.email"}})],1),s("el-form-item",{staticClass:"refresh"},[s("div",{staticClass:"container"},[s("div",{staticClass:"refresh-img"},[s("img",{staticClass:"refresh-img",attrs:{src:t.captcha,alt:"refresh"}})]),s("div",{staticClass:"refresh-button"},[s("a",{attrs:{href:"javascript:;"},on:{click:t.getCaptcha}},[s("i",{staticClass:"el-icon-refresh-right"}),t._v(" "+t._s(t.$t("login.common.form.refresh"))+" ")])]),s("div",{staticClass:"refresh-code"},[s("el-input",{attrs:{placeholder:t.$t("login.common.form.code"),clearable:""},model:{value:t.form.data.captcha,callback:function(e){t.$set(t.form.data,"captcha",e)},expression:"form.data.captcha"}})],1)])])],1)],1),s("div",{staticClass:"tip"},[t._v(" "+t._s(t.$t("login.findID.forget.text1"))+" "),s("router-link",{attrs:{to:"/findID"}},[t._v(t._s(t.$t("login.findID.forget.text2")))])],1),s("el-button",{attrs:{type:"primary",disabled:t.disabled,round:""},on:{click:t.doSubmit}},[t._v(t._s(t.$t("common.resume")))])],1),s("div",{staticClass:"spliter"}),s("div",{staticClass:"right"},[s("img",{attrs:{src:n,alt:"logo"}}),s("p",[t._v(t._s(t.$t("login.common.tip.forget")))])])])],1)])},h=[],p=m(d,f,h,!1,null,"06f99748",null,null);const v=p.exports;export{v as default};
