"use strict";(self["webpackChunkautoshopee_kit"]=self["webpackChunkautoshopee_kit"]||[]).push([[4004],{71534:function(t,s,e){e.d(s,{Z:function(){return c}});var r=function(){var t=this,s=t._self._c;return s("div",[t.getIsAuthed?s("Alert",{staticClass:"hand-hover mt-10",attrs:{type:"success","show-icon":""}},[t._v(" "+t._s(t.$t("USER_WAS_LOGGED"))+" ")]):s("Row",{staticStyle:{"margin-top":"50px"}},[s("Col",{attrs:{span:24}},[s("Card",{attrs:{"dis-hover":""}},[s("div",{staticClass:"text-center",attrs:{slot:"title"},slot:"title"},[s("i",{staticClass:"fa fa-user-o mr-5",attrs:{"aria-hidden":"true"}}),s("b",[t._v(t._s(t.$t("LOGIN_USER")))])]),s("div",[s("Row",{staticClass:"text-center",attrs:{gutter:20}},[s("Col",{staticClass:"mb-10 mt-10",attrs:{span:24}},[s("Input",{attrs:{placeholder:t.$t("USERNAME")},model:{value:t.form.username,callback:function(s){t.$set(t.form,"username",s)},expression:"form.username"}})],1),s("Col",{staticClass:"mb-10 mt-10",attrs:{span:24}},[s("Input",{attrs:{type:"password",placeholder:t.$t("PASSWORD")},model:{value:t.form.password,callback:function(s){t.$set(t.form,"password",s)},expression:"form.password"}})],1),s("Col",{staticClass:"mb-10 mt-10",attrs:{span:24}},[s("Button",{attrs:{type:"primary",long:"",disabled:!t.form.username||!t.form.password,loading:t.loading},on:{click:t.loginSubmit}},[t._v(" "+t._s(t.$t("BTN_LOGIN"))+" ")])],1),s("Col",{attrs:{span:24}},[s("div",{staticClass:"text-right"},[s("a",{attrs:{href:"javascript:void(0)"},on:{click:t.openPageRegister}},[t._v(" "+t._s(t.$t("BTN_REGISTER"))+" ")])])])],1)],1)]),s("div",{staticClass:"mt-10 text-right"},[s("i",[t._v(" "+t._s(t.$t("LOGIN_PAGE_NOTE"))+" ")])])],1)],1)],1)},a=[],o=e(90408),i=e(68074),n=e.n(i),l={name:"LoginIndex",data(){return{loading:!1,form:{username:"",password:""},returnUrl:""}},methods:{...(0,o.nv)(["SetToken","SetUser","SetLogin","Logout"]),openPageRegister(){this.openExternalUrl(this.configApp.registerUrl)},async loginSubmit(){this.loading=!0;try{const t=await this.UserLogin(this.form);if(!t.success||!t.token)throw this.$Message.error(t.msg||this.$t("LOGIN_ERROR")),{msg:"LOGIN_ERROR",result:t};if(this.$Message.success(this.$t("LOGIN_SUCCESS")),await n()(500),this.returnUrl)return this.RouterPath(this.returnUrl);this.RouterTo("root")}catch(t){console.error({msg:"LOGIN_ERROR",error:t})}this.loading=!1},autoLogin(){const{username:t,password:s,ref:e}=this.$route.query;if(!t||!s)return!1;this.form.username=t,this.form.password=s,"shop-manager"===e&&this.SetUseShopManager(!0),delete this.$route.params.username,delete this.$route.params.password,this.$router.replace({name:this.$route.name,params:this.$route.params,query:{}});const r=this.loginSubmit;return setTimeout(r,200)}},created(){this.returnUrl=this.$route.query.returnUrl,this.form.username=this.getUsername,this.form.password=this.getPassword,this.autoLogin()}},u=l,h=e(1001),m=(0,h.Z)(u,r,a,!1,null,null,null),c=m.exports},34004:function(t,s,e){e.r(s),e.d(s,{default:function(){return h}});var r=function(){var t=this,s=t._self._c;return s("div",[s("Row",[s("Col",{attrs:{span:12,offset:6}},[s("login")],1)],1)],1)},a=[],o=e(71534),i={name:"LoginPoup",components:{login:o.Z}},n=i,l=e(1001),u=(0,l.Z)(n,r,a,!1,null,null,null),h=u.exports}}]);
//# sourceMappingURL=4004.dae32778.js.map