/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: /home/liman/panel/js/2755.eebaef1e.js
"use strict";(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[2755],{12213:function(t,e,s){s.r(e),s.d(e,{default:function(){return d}});var o=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{class:t.per},[o("img",{staticClass:"mb-5",attrs:{src:s(32470)}}),1===t.loginMode?[o("sedmed-form",{attrs:{items:t.fromItems,step:t.formStep,"btn-ghost":!0,"btn-block":!0,"btn-type":"test",initialValue:t.mobileLoginValues,"is-final-step":!0,containerClass:"grid grid-cols-1"},on:{create:t.changeSteps},scopedSlots:t._u([{key:"btnText",fn:function(){return[t._v(" "+t._s(1===t.formStep?"ارسال کد":"ورود")+" ")]},proxy:!0},2===t.formStep?{key:"afterBtn",fn:function(){return[o("a-button",{staticClass:"mt-2",staticStyle:{color:"black"},attrs:{block:"",disabled:0!==t.countdown},on:{click:t.resendToken}},[t._v(" ارسال مجدد کد (00:"+t._s(t.countdown)+")")]),o("a-button",{staticClass:"mt-2",staticStyle:{color:"black"},attrs:{block:""},on:{click:t.resetMobile}},[t._v(" تغیر شماره تلفن ")])]},proxy:!0}:null],null,!0)})]:t._e(),2===t.loginMode?[o("sedmed-form",{attrs:{items:t.fromItemsUserPass,"btn-ghost":!0,"btn-block":!0,"btn-type":"test",containerClass:"grid grid-cols-1",okText:"ورود"},on:{create:t.loginByUserPass}})]:t._e(),[0===t.loginMode?o("h4",{staticClass:"text-white"},[t._v("نوع ورود")]):t._e(),1!==t.loginMode?o("a-button",{staticClass:"mt-2",attrs:{block:"",ghost:""},on:{click:function(e){t.loginMode=1}}},[t._v(" ورود با موبایل ")]):t._e(),2!==t.loginMode?o("a-button",{staticClass:"mt-2",attrs:{block:"",ghost:""},on:{click:function(e){t.loginMode=2}}},[t._v(" ورود با نام کاربری ")]):t._e()]],2)},a=[],i=s(89058),n={name:"LoginPage",data(){return{mobileLoginValues:void 0,fromItems:{mobile:{label:"شماره تلفن",decorator:[{defaultKey:"required"},{defaultKey:"mobile"}],step:1},token:{label:"کد ارسال شده",custom:{type:"number",min:1e3,max:9999},decorator:[{defaultKey:"required"}],step:2,itemCls:"w-full hide-counter"}},fromItemsUserPass:{username:{label:"نام کاربری",decorator:[{defaultKey:"required"}]},password:{label:"کلمه عبور",decorator:[{defaultKey:"required"}]}},formStep:1,loginMode:0,countdown:59,mobile:""}},components:{sedmedForm:i.Z},computed:{per(){return`${this.$prefix}-login`}},methods:{async setUserData(t){localStorage.setItem("access",t.access.toString()),localStorage.setItem("refresh",t.refresh.toString()),this.$nextTick((async()=>{await this.$store.dispatch("user/getUserData")}))},async changeSteps(t){1===this.formStep?(this.mobile=t.mobile,await this.getCode(),this.StartCountdown()):await this.loginByMobile(t)},async loginByMobile(t){try{await this.$store.commit("setLoading",!0);const{data:e}=await this.$caxios.post("auth/login/2fa",{mobile:this.mobile,token:t.token.toString()});await this.setUserData(e),await this.$router.push({name:"dashboard"}),this.$ntSuccess("با موفقیت وارد شدید")}catch(e){console.log(e)}finally{await this.$store.commit("setLoading",!1)}},async loginByUserPass(t){try{await this.$store.commit("setLoading",!0);const{data:e}=await this.$caxios.post("auth/login",t);await this.setUserData(e),await this.$router.push({name:"dashboard"}),this.$ntSuccess("با موفقیت وارد شدید")}catch(e){console.log(e)}finally{await this.$store.commit("setLoading",!1)}},async resendToken(){this.countdown=59,await this.getCode(),this.StartCountdown()},async getCode(){try{await this.$store.commit("setLoading",!0);const{data:t}=await this.$caxios.post("auth/login/2fa",{mobile:this.mobile});"success"===t.status.type&&(this.$ntSuccess(t.status.message),this.formStep=2)}catch(t){console.log(t)}finally{await this.$store.commit("setLoading",!1)}},StartCountdown(){this.countdown>0&&setTimeout((()=>{this.countdown>0&&(this.countdown-=1,this.StartCountdown())}),1e3)},resetMobile(){this.formStep=1}}},r=n,l=s(38e3),c=(0,l.Z)(r,o,a,!1,null,null,null),d=c.exports}}]); //# sourceMappingURL=2755.eebaef1e.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure