Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

2 рядки
5.8 KiB

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