No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

2 líneas
5.8 KiB

  1. "use strict";(self["webpackChunkTruckShop"]=self["webpackChunkTruckShop"]||[]).push([[351],{351:function(e,t,a){a.r(t),a.d(t,{default:function(){return U}});var l=a(6768),o=a(5130),r=a(4232);const s={class:"auth-main v2"},n={class:"auth-wrapper"},i={class:"auth-form"},u={class:"card my-5 mx-3"},c={class:"card-body",style:{direction:"rtl"}},d={class:"text-center mb-4"},p=["src"],v={class:"mb-3"},b={class:"mb-3"},m={key:0,class:"text-danger"},k={key:0,class:"mt-3"},g={class:"mb-3"},y=["disabled"],f={key:0,class:"text-danger"},h={key:0},C={key:1},L={key:0,class:"d-grid mt-3"},O=["disabled"],E={key:0,class:"spinner-border spinner-border-sm",role:"status","aria-hidden":"true"},R={key:1},X={class:"d-grid mt-3"},A=["disabled"],S={key:0,class:"spinner-border spinner-border-sm",role:"status","aria-hidden":"true"},K={key:1};function x(e,t,a,x,I,_){const j=(0,l.g2)("router-link"),w=(0,l.g2)("Rightbar");return(0,l.uX)(),(0,l.CE)(l.FK,null,[(0,l.Lk)("div",s,[t[10]||(t[10]=(0,l.Lk)("div",{class:"bg-overlay bg-dark"},null,-1)),(0,l.Lk)("div",n,[(0,l.Lk)("div",i,[(0,l.Lk)("div",u,[(0,l.Lk)("div",c,[(0,l.Lk)("div",d,[(0,l.Lk)("img",{src:x.logo,alt:"Logo",class:"styled-logo"},null,8,p)]),t[9]||(t[9]=(0,l.Lk)("h4",{class:"f-w-500 mb-1"},"ورود با کد یکبار مصرف",-1)),(0,l.Lk)("p",v,[t[8]||(t[8]=(0,l.eW)(" یا ",-1)),(0,l.bF)(j,{to:"/login-v2",class:"link-primary"},{default:(0,l.k6)((()=>t[7]||(t[7]=[(0,l.eW)(" ورود با رمز عبور ",-1)]))),_:1,__:[7]})]),(0,l.Lk)("div",b,[(0,l.bo)((0,l.Lk)("input",{onInput:t[0]||(t[0]=e=>x.clearError("mobile")),type:"text",class:"form-control",id:"floatingInput",placeholder:"شماره تماس","onUpdate:modelValue":t[1]||(t[1]=e=>x.mobile=e)},null,544),[[o.Jo,x.mobile]]),x.errors.mobile?((0,l.uX)(),(0,l.CE)("small",m,(0,r.v_)(x.errors.mobile),1)):(0,l.Q3)("",!0)]),x.otpSent?((0,l.uX)(),(0,l.CE)("div",k,[(0,l.Lk)("div",g,[(0,l.bo)((0,l.Lk)("input",{onInput:t[2]||(t[2]=e=>x.clearError("otpCode")),type:"text",class:"form-control",placeholder:"کد ورود","onUpdate:modelValue":t[3]||(t[3]=e=>x.otpCode=e),disabled:0===x.timer},null,40,y),[[o.Jo,x.otpCode]]),x.errors.otpCode?((0,l.uX)(),(0,l.CE)("small",f,(0,r.v_)(x.errors.otpCode),1)):(0,l.Q3)("",!0)]),(0,l.Lk)("div",null,[x.timer>0?((0,l.uX)(),(0,l.CE)("p",h,"زمان باقی‌مانده: "+(0,r.v_)(x.timer)+" ثانیه",1)):((0,l.uX)(),(0,l.CE)("p",C,"زمان منقضی شده است."))]),x.otpSent&&x.timer>0?((0,l.uX)(),(0,l.CE)("div",L,[(0,l.Lk)("button",{onClick:t[4]||(t[4]=(...e)=>x.verifyOtp&&x.verifyOtp(...e)),type:"button",class:"btn btn-success",disabled:x.verifyOtpLoading},[x.verifyOtpLoading?((0,l.uX)(),(0,l.CE)("span",E)):((0,l.uX)(),(0,l.CE)("span",R,"ورود"))],8,O)])):(0,l.Q3)("",!0)])):(0,l.Q3)("",!0),(0,l.Lk)("div",X,[x.otpSent?(0,l.Q3)("",!0):((0,l.uX)(),(0,l.CE)("button",{key:0,onClick:t[5]||(t[5]=(...e)=>x.sendOtp&&x.sendOtp(...e)),type:"button",class:"btn btn-primary",disabled:x.sendOtpLoading},[x.sendOtpLoading?((0,l.uX)(),(0,l.CE)("span",S)):((0,l.uX)(),(0,l.CE)("span",K," ارسال کد ورود "))],8,A)),x.resendAvailable&&x.otpSent?((0,l.uX)(),(0,l.CE)("button",{key:1,onClick:t[6]||(t[6]=(...e)=>x.resendOtp&&x.resendOtp(...e)),type:"button",class:"btn btn-primary"}," ارسال مجدد کد ")):(0,l.Q3)("",!0)])])])])])]),(0,l.bF)(w)],64)}a(4114);var I=a(9891),_=a(144),j=a(1387),w=a(782),Q=a(9317),T=a(4874),F=a.n(T),P={name:"FORGOT-PASSWORD",components:{Rightbar:I.A},setup(){const e=(0,_.KR)(),t=(0,_.KR)(),a=(0,_.KR)(!1),o=(0,_.KR)(!1),r=(0,_.KR)({}),s=(0,j.rd)(),n=(0,w.Pj)(),i=(0,_.KR)(""),u=(0,_.KR)(!1),c=(0,_.KR)(60),d=(0,_.KR)(""),p=(0,_.KR)(!1);let v=null;const b=()=>{y()&&(o.value=!0,Q.A.post("auth/send-otp",{mobile:i.value}).then((()=>{u.value=!0,p.value=!1,o.value=!1,F().fire({icon:"info",title:"کد تایید ارسال شد",text:"کد تایید به شماره شما ارسال شد. لطفاً کد را قبل از منقضی شدن وارد نمایید",confirmButtonText:"باشه"}),m()})).catch((e=>{console.log(e),F().fire({icon:"error",title:"خطا در ارسال کد",text:e.response.data.message,confirmButtonText:"متوجه شدم"}),o.value=!1})))},m=()=>{v=setInterval((()=>{c.value>0?c.value--:(clearInterval(v),p.value=!0)}),1e3)},k=()=>{d.value="",c.value=60,p.value=!1,b(),m()},g=async()=>{if(f()){a.value=!0;try{await n.dispatch("user/verifyOtp",{mobile:i.value,otpCode:d.value}),a.value=!1,s.push({name:"products"})}catch(e){a.value=!1}}},y=()=>(r.value={},i.value||(r.value.mobile="موبایل خود را وارد نمایید"),0===Object.keys(r.value).length),f=()=>(r.value={},i.value||(r.value.mobile="موبایل خود را وارد نمایید"),d.value||(r.value.otpCode="کد ارسالی را وارد نمایید"),0===Object.keys(r.value).length),h=e=>{r.value[e]=""},C=async()=>{const a=localStorage.getItem("logo");if(a)t.value=a;else try{const a=await Q.A.get("settings/logo_fav");e.value=a.data.data,t.value=e.value.value,localStorage.setItem("logo",t.value)}catch(l){console.error("Error fetching settings:",l)}};return(0,l.hi)((()=>{v&&clearInterval(v)})),(0,l.sV)((()=>{C()})),{sendOtp:b,resendOtp:k,mobile:i,otpSent:u,otpCode:d,timer:c,resendAvailable:p,verifyOtp:g,clearError:h,errors:r,validateVerifyOtpForm:f,sendOtpLoading:o,verifyOtpLoading:a,settings:e,logo:t}}},V=a(1241);const B=(0,V.A)(P,[["render",x],["__scopeId","data-v-1fc16694"]]);var U=B},9317:function(e,t,a){a(4114);var l=a(4373),o=a(494);const r="http://85.208.254.227/api/v1/",s=l.A.create({baseURL:r,headers:{Accept:"application/json","Content-Type":"application/json"}});s.interceptors.request.use((e=>{const t=localStorage.getItem("token");return t&&(e.headers["Authorization"]=`Bearer ${t}`),e}),(e=>Promise.reject(e))),s.interceptors.response.use((e=>e),(e=>(401===e?.status&&o.A.push({name:"login-v2"}),Promise.reject(e)))),t.A=s}}]);
  2. //# sourceMappingURL=351.7c98133b.js.map