import{s as w}from"./request.e6b427ef.js";import{_ as I,r as i,o as x,c as k,a as n,b as t,w as s,d as c,p as y,e as F}from"./index.fa63d907.js";function S(o,e){return w({url:"/check/login",method:"post",data:{Account:o,Password:e,AppKey:"openauth"}})}const v={data(){return{loginForm:{email:"",password:""},rules:{email:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D26\u53F7",trigger:"blur"}],password:[{required:!0,message:"\u8BF7\u8F93\u5165\u5BC6\u7801",trigger:"blur"}]},rememberPassword:!1}},watch:{rememberPassword:function(o){o==!1&&(localStorage.setItem("remember",!1),localStorage.setItem("loginInfo",""))}},created(){this.checkIsRememberPassword()},methods:{submitForm(o){axios.post("http://60.213.14.14:6050/api/Check/Login",{account:"System",appKey:"openauth",password:"HopetryA1406"}).then(e=>{if(e.data.code==200){let r=e.data.token;localStorage.setItem("XToken",r)}}),this.$refs[o].validate(e=>{if(e)S(this.loginForm.email,this.loginForm.password).then(r=>{r.code==200&&r.token!=""?(localStorage.setItem("Token",r.token),localStorage.setItem("username",this.loginForm.email),this.$message.success("\u767B\u5F55\u6210\u529F\uFF01"),this.$router.push("/cityIndex?id=1700021665322237952&title=\u56ED\u6797\u666F\u89C2"),this.rememberPasswordFun()):this.$message.error("\u8D26\u53F7\u6216\u5BC6\u7801\u9519\u8BEF\uFF01")}).catch(r=>{this.$message.error("\u8D26\u53F7\u6216\u5BC6\u7801\u9519\u8BEF\uFF01")});else return!1})},resetForm(o){this.$refs[o].resetFields()},rememberPasswordFun(){this.rememberPassword==!0?(localStorage.setItem("remember",!0),localStorage.setItem("loginInfo",JSON.stringify(this.loginForm))):(localStorage.setItem("remember",!1),localStorage.setItem("loginInfo",""))},checkIsRememberPassword(){localStorage.getItem("remember")=="true"&&(this.rememberPassword=!0,this.loginForm=JSON.parse(localStorage.getItem("loginInfo")))}}},d=o=>(y("data-v-435c6700"),o=o(),F(),o),V={class:"main-container"},P=d(()=>n("div",{class:"title-container"},null,-1)),N=d(()=>n("div",{class:"title"},[n("p",{style:{"font-size":"24px","letter-spacing":"0.6ch","margin-bottom":"32px"}},"\u8D39\u53BF\u57CE\u5E02\u7EFC\u5408\u7BA1\u7406\u5E73\u53F0")],-1)),C={class:"login-form"},T={style:{"text-align":"center","font-size":"18px",color:"#666","font-weight":"bold","line-height":"50px","margin-bottom":"42px"}},A=c(" \u624B\u673A\u53F7\u7801\u767B\u5F55 "),B=d(()=>n("i",{slot:"prefix",class:"el-input__icon el-icon-mobile-phone"},null,-1)),L=d(()=>n("i",{slot:"prefix",class:"el-input__icon el-icon-lock"},null,-1)),U=c(" \u8BB0\u4F4F\u5BC6\u7801 "),q=c("\u7ACB\u5373\u6CE8\u518C>>"),z=c("\u7ACB \u5373 \u767B \u5F55");function J(o,e,r,K,l,_){const p=i("el-button"),u=i("el-input"),m=i("el-form-item"),g=i("el-checkbox"),f=i("el-link"),h=i("router-link"),b=i("el-form");return x(),k("div",V,[P,N,n("div",C,[n("p",T,[t(p,{type:"primary",icon:"Iphone",style:{position:"relative",top:"-3px",left:"-12px"},circle:""}),A]),t(b,{model:l.loginForm,rules:l.rules,ref:"loginForm","label-width":"100px",class:"demo-ruleForm","label-position":"top"},{default:s(()=>[t(m,{label:"",prop:"email"},{default:s(()=>[t(u,{modelValue:l.loginForm.email,"onUpdate:modelValue":e[0]||(e[0]=a=>l.loginForm.email=a),placeholder:"\u624B\u673A\u53F7\u7801"},{default:s(()=>[B]),_:1},8,["modelValue"])]),_:1}),t(m,{label:"",prop:"password"},{default:s(()=>[t(u,{modelValue:l.loginForm.password,"onUpdate:modelValue":e[1]||(e[1]=a=>l.loginForm.password=a),type:"password",placeholder:"\u767B\u5F55\u5BC6\u7801","show-password":""},{default:s(()=>[L]),_:1},8,["modelValue"])]),_:1}),t(m,{label:"",prop:"agreement"},{default:s(()=>[t(g,{modelValue:l.rememberPassword,"onUpdate:modelValue":e[2]||(e[2]=a=>l.rememberPassword=a)},{default:s(()=>[U]),_:1},8,["modelValue"]),t(h,{to:{path:"/register"}},{default:s(()=>[t(f,{style:{float:"right"},type:"primary",underline:!1},{default:s(()=>[q]),_:1})]),_:1})]),_:1}),t(m,null,{default:s(()=>[t(p,{type:"primary",style:{width:"100%"},onClick:e[3]||(e[3]=a=>_.submitForm("loginForm"))},{default:s(()=>[z]),_:1})]),_:1})]),_:1},8,["model","rules"])])])}var X=I(v,[["render",J],["__scopeId","data-v-435c6700"]]);export{X as default};
