text: (window.webpackJsonp=window.webpackJsonp||[]).push([[38],{1133:function(e,t,o){var content=o(1179);"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,o(56).default)("70baf9b8",content,!0,{sourceMap:!1})},1178:function(e,t,o){"use strict";o(1133)},1179:function(e,t,o){var n=o(55)((function(i){return i[1]}));n.push([e.i,".login-container{height:100vh;width:100vw;padding:6rem 1rem 1rem}.login-container .lang{position:fixed;bottom:1rem;right:1rem}.login-container .reset{position:fixed;bottom:1rem;left:1rem}.login-container .reg{margin-top:2.5rem;text-align:center;color:#95a5a6}.login-container .reg *{color:#f4f7fc}.login-container .title{color:#f4f7fc;display:block;font-size:2.5rem}.login-container .subtitle{color:#f4f7fc;font-size:1.5rem}.login-container .el-form{display:block;margin-top:3rem}.login-container .el-form input{background:transparent;color:#f4f7fc;text-align:center;border:none;border-bottom:1px solid #95a5a6;border-radius:0;padding:2rem;font-size:1.2rem}.login-container .el-form input:focus,.login-container .el-form input:hover{border-color:#1abc9c}.login-container .el-form .el-button{margin-top:2rem;font-size:1rem;padding:.5rem 3rem;border-radius:50px}.login-container .el-form .el-button[type=success]{background:#1abc9c;border:none}.login-container .el-form a{margin-top:1rem}.login-container .token-text{margin-top:1.5rem}.login-container .token-text a{padding-bottom:0}",""]),e.exports=n},1322:function(e,t,o){"use strict";o.r(t);o(8),o(79),o(97);var n=o(16),r={middleware:["load-rt-data"],data:function(){return console.log(this),console.log("log from login_app..."),console.log(this.$eStore),console.log(this.$store),{logging_in:!1,state:"login",zip_prompt:!1,loginInfo:{email:"",password:"",ref:""},email_token:null}},computed:{mail_link:function(){return"mailto:passwordchange@mg.1s.life?subject=".concat(this.email_token,":您的新密码")}},created:function(){},mounted:function(){n.remote.process.execPath.includes("Temp")&&(this.zip_prompt=!0)},methods:{requestPasswordReset:function(){var e=this;if(!this.loginInfo.email)return this.$message({message:"请填写注册邮箱",type:"error"}),this.logging_in=!1;this.$store.dispatch("requestPasswordReset",{email:this.loginInfo.email}).then((function(body){console.log(body),alert("邮件正在发送至该邮箱，请点击邮件内链接获取新密码。\n若*30分钟*依然未收到邮件，请与网站客服联系"),e.email_token=body.email_token}),(function(t){var o;return"illegal email"===(null===(o=t=t.data)||void 0===o?void 0:o.message)||"not found"===t.message?e.$message({message:"未找到此邮箱地址。若您确认以此邮箱注册，请联系网站客服。",type:"error"}):e.$message({message:"服务器处理出错，请稍后重试:"+t.message,type:"error"})})).finally((function(){e.logging_in=!1}))},signUp:function(){var e=this;if(console.log(this.loginInfo),!this.loginInfo.email||!this.loginInfo.password)return this.$message({message:"请填写注册邮箱和密码",type:"error"}),this.logging_in=!1;this.$store.dispatch("signUp",this.loginInfo).then((function(body){return console.log("new user:",body),e.logIn()})).catch((function(t){console.log(t.data);var o="未知错误，可能服务器抽风了，请稍后再试 ".concat(t.data);return t.data&&"already exists"===t.data.message&&(o="该账号已注册，请直接登录"),e.$message({message:o,type:"error"})})).finally((function(){e.logging_in=!1}))},logIn:function(){var e=this;if(!this.loginInfo.email||!this.loginInfo.password)return this.$message({message:"请填写注册邮箱和密码",type:"error"}),this.logging_in=!1;this.$store.dispatch("login",this.loginInfo).then((function(body){console.log("sessions_body",body),e.$message({message:"登录成功，正在加载服务信息...",type:"success"}),e.$store.dispatch("getUserAndService").then((function(t){console.log("got data."),console.log(t),e.loading_data=!1,e.logging_in=!1,e.$router.push({path:"/dashboard/dashboard/"})})).catch((function(t){console.log("get user&service e-----\x3e",t),e.logging_in=!1;return"found no valid service"===t&&e.$message({message:e.$t("select_service.suspend.time"),type:"error"}),"service data suspended"===t&&e.$message({message:e.$t("select_service.suspend.data"),type:"error"}),"no service purchased"===t&&e.$message({message:e.$t("select_service.suspend.empty"),type:"info"}),e.$router.push({path:"/buy-service/"})}))})).catch((function(t){e.logging_in=!1,console.log("e--\x3e>",t);var o="未知错误，可能服务器抽风了，请稍后再试 ".concat(t);return t.data&&"no such user"===t.data.message&&(o="未找到该账号"),t.data&&"email/password not match"===t.data.message&&(o="账号/密码错误"),e.$message({message:o,type:"error"})}))},onSubmit:function(){return this.logging_in=!0,"reset"===this.state?this.requestPasswordReset():"signup"===this.state?this.signUp():this.logIn()},exit:function(){n.remote.app.quit()}}},l=(o(1178),o(42)),component=Object(l.a)(r,(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"login-container"},[o("el-row",{attrs:{type:"flex",justify:"center",align:"center"}},[o("center",[o("h1",{staticClass:"title"},[e._v(e._s(e.$t("login.title")))])])],1),o("el-row",[o("el-form",{attrs:{"label-position":"right","label-width":"80px",model:e.loginInfo},nativeOn:{submit:function(t){return t.preventDefault(),e.onSubmit(t)}}},[o("el-input",{attrs:{type:"email",placeholder:e.$t("login.email"),"prefix-icon":"el-icon-caret-right"},model:{value:e.loginInfo.email,callback:function(t){e.$set(e.loginInfo,"email",t)},expression:"loginInfo.email"}}),o("el-input",{directives:[{name:"show",rawName:"v-show",value:"reset"!==e.state,expression:"state !== 'reset'"}],attrs:{type:"password",placeholder:e.$t("login.password"),"prefix-icon":"el-icon-caret-right"},model:{value:e.loginInfo.password,callback:function(t){e.$set(e.loginInfo,"password",t)},expression:"loginInfo.password"}}),o("el-input",{directives:[{name:"show",rawName:"v-show",value:"signup"==e.state,expression:"state == 'signup'"}],attrs:{type:"text",placeholder:e.$t("login.ref"),"prefix-icon":"el-icon-caret-right"},model:{value:e.loginInfo.ref,callback:function(t){e.$set(e.loginInfo,"ref",t)},expression:"loginInfo.ref"}}),o("center",[o("el-button",{directives:[{name:"show",rawName:"v-show",value:"login"==e.state,expression:"state == 'login'"}],attrs:{round:"","native-type":"submit",type:"primary",loading:e.logging_in}},[e._v(e._s(e.$t("login.button")))]),o("el-button",{directives:[{name:"show",rawName:"v-show",value:"reset"==e.state,expression:"state == 'reset'"}],attrs:{round:"","native-type":"submit",type:"warning",loading:e.logging_in}},[e._v(e._s(e.$t("login.reset.button")))]),o("el-button",{directives:[{name:"show",rawName:"v-show",value:"signup"==e.state,expression:"state == 'signup'"}],attrs:{round:"","native-type":"submit",type:"primary",loading:e.logging_in}},[e._v(e._s(e.$t("login.signup_button")))])],1)],1),o("el-card",{directives:[{name:"show",rawName:"v-show",value:"reset"==e.state&&e.email_token,expression:"state == 'reset' && email_token"}],staticClass:"token-text"},[o("center",[o("h4",[e._v("重置密码的邮件已发往您的邮箱")]),o("br")]),o("h5",[e._v("若收不到重置邮件，您可以在30分钟内通过您的邮箱发送"),o("b",[e._v("标题")]),e._v("为"),o("code",[e._v(e._s(e.email_token)+":")]),e._v(" +  "),o("code",[e._v("您的新密码")]),e._v("的邮件到"),o("br"),o("center",[o("a",{attrs:{href:e.mail_link}},[e._v("passwordchange@mg.1s.life")])]),o("br"),e._v("例如，发送邮件标题为"),o("code",[e._v(e._s(e.email_token)+":123123")]),e._v("将会修改您的账号密码为"),o("code",[e._v("123123")]),o("br"),e._v("邮件内容可任意或留空")],1)],1)],1),o("p",{staticClass:"reg"},[o("a",{directives:[{name:"show",rawName:"v-show",value:"login"==e.state,expression:"state == 'login'"}],on:{click:function(t){e.state="signup"}}},[e._v(e._s(e.$t("login.signup_hint")))]),o("a",{directives:[{name:"show",rawName:"v-show",value:"signup"==e.state,expression:"state == 'signup'"}],on:{click:function(t){e.state="login"}}},[e._v(e._s(e.$t("login.text")))])]),o("el-row",[o("a",{staticClass:"lang",on:{click:e.switchLang}},[e._v(e._s(e.$t("change_lang_button")))]),o("a",{directives:[{name:"show",rawName:"v-show",value:"login"==e.state,expression:"state == 'login'"}],staticClass:"reset",on:{click:function(t){e.state="reset"}}},[e._v(e._s(e.$t("login.reset.text")))]),o("a",{directives:[{name:"show",rawName:"v-show",value:"reset"==e.state,expression:"state == 'reset'"}],staticClass:"reset",on:{click:function(t){e.state="login"}}},[e._v(e._s(e.$t("login.text")))])]),o("el-dialog",{attrs:{visible:e.zip_prompt,"show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1,width:"80%",center:""},on:{"update:visible":function(t){e.zip_prompt=t}}},[o("center",[o("h1",{staticClass:"warning"},[o("b",[e._v("请勿从压缩包里直接运行")])]),o("br"),o("h4",[o("b",[e._v("看起来您直接从压缩包里运行着客户端，请先将所有文件解压到电脑里，然后运行解压出来的客户端")])])]),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("center",[o("el-button",{attrs:{type:"success"},on:{click:e.exit}},[e._v("退出")])],1)],1)],1)],1)}),[],!1,null,null,null);t.default=component.exports}}]);