|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/sbaedu/test.sbaedu.com/static/js/ |
Upload File : |
"use strict";(self.webpackChunktechwind=self.webpackChunktechwind||[]).push([[534],{9172:(e,a,t)=>{t.d(a,{aX:()=>d,c0:()=>l,gF:()=>c,k6:()=>m});var s=t(3402),r=t(4592),o=t(1822);s.Z.defaults.baseURL=o.gA;const n=r.Z.get("icp_authData")?JSON.parse(r.Z.get("icp_authData")):null,i=n?n.token:null,d=async e=>{try{const a=await s.Z.post("/register",e,{headers:{apikey:o.vo,domain:o.nw}});a.data.data;return localStorage.setItem("icp_islogin","true"),a}catch(a){return console.log("Registration failed:",a),a||{status:500,data:{message:"An unexpected error occurred."}}}},c=async e=>{try{return await s.Z.post("/forgot-password",e,{headers:{apikey:o.vo,domain:o.nw}})}catch(a){return a||{status:500,data:{message:"An unexpected error occurred."}}}},l=async e=>{try{return await s.Z.post("/forgot-password-continue",e,{headers:{apikey:o.vo,domain:o.nw}})}catch(a){return a||{status:500,data:{message:"An unexpected error occurred."}}}},m=async e=>{try{return await s.Z.post("/update-profile",e,{headers:{apikey:o.vo,domain:o.nw,token:i}})}catch(a){return a||{status:500,data:{message:"An unexpected error occurred."}}}}},2987:(e,a,t)=>{t.d(a,{Q:()=>d,n:()=>c});var s=t(2595),r=t(8700),o=t(3402),n=t(1822);o.Z.defaults.baseURL=n.gA;const i=new r.Z,d=e=>async a=>{a({type:s.Cn,payload:[]});try{const t=await o.Z.post("/login",e,{headers:{apikey:n.vo,domain:n.nw}}),r=t.data.data;localStorage.setItem("icp_islogin","true"),localStorage.setItem("icp_authData",JSON.stringify(r)),a({type:s.XP,payload:t.data})}catch(t){a({type:s.iP,error:t})}},c=()=>e=>{localStorage.removeItem("icp_islogin"),localStorage.removeItem("icp_authData"),i.remove("icp_authData"),e({type:s.Nv})}},5534:(e,a,t)=>{t.r(a),t.d(a,{default:()=>g});var s=t(9867),r=t(4670),o=t(5644),n=(t(9172),t(8700)),i=t(8057),d=t.n(i),c=t(4436),l=t(2987),m=t(8960),u=(t(1461),t(2834));function g(){const e=(0,r.s0)(),[a,t]=(0,s.useState)(null),i=(0,c.I0)(),{loginReducer:g}=(0,c.v9)((e=>e)),p=(0,c.v9)((e=>e.websiteReducer.data.data.site_logo)),x=new n.Z,[h,b]=(0,s.useState)({state:!1,title:"",icon:"default",message:""});(0,s.useEffect)((()=>{f()}),[g,e]);const f=(0,s.useCallback)((()=>{if(1===g.data.status){t(!0);const a=g.data.data;return x.set("icp_authData",JSON.stringify(a)),x.get("icp_authData")&&(setTimeout((function(){m.Am.success("Login Success")}),5e5),e("/")),!1}if(g.error){const e=g.error.response.data.message;t(!1),m.Am.error(e)}}),[g,e]),y=()=>(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(d(),{show:h.state,title:h.title,type:h.icon,customButtons:(0,u.jsx)(u.Fragment,{children:(0,u.jsx)("div",{className:"flex flex-row justify-between items-center",children:(0,u.jsx)("div",{children:(0,u.jsx)("button",{onClick:()=>b({state:!1}),className:"bg-blue-700 text-white px-3 py-1 border",sx:{py:1,mr:2},children:"Cancel"})})})}),onConfirm:()=>{},children:h.message})});return(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("section",{className:"md:h-screen py-36 flex items-center bg-no-repeat bg-center bg-cover",children:[(0,u.jsx)(m.Ix,{}),(0,u.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent to-black"}),(0,u.jsx)("div",{className:"container relative",children:(0,u.jsx)("div",{className:"flex justify-center",children:(0,u.jsxs)("div",{className:"max-w-[400px] w-full m-auto p-6 bg-white dark:bg-slate-900 shadow-md dark:shadow-gray-800 rounded-md",children:[(0,u.jsx)(o.rU,{to:"/index",children:(0,u.jsx)("img",{src:p||"",className:"mx-auto width40",alt:""})}),(0,u.jsx)("h5",{className:"my-6 text-xl font-semibold",children:"Login"}),(0,u.jsx)("form",{className:"text-start",onSubmit:async e=>{e.preventDefault();const a=e.target,t={email_or_phone:a.email.value,password:a.password.value};i((0,l.Q)(t))},children:(0,u.jsxs)("div",{className:"grid grid-cols-1",children:[(0,u.jsxs)("div",{className:"mb-4",children:[(0,u.jsx)("label",{className:"font-semibold",htmlFor:"LoginEmail",children:"Email Address:"}),(0,u.jsx)("input",{id:"LoginEmail",type:"email",className:"form-input mt-3 w-full py-2 px-3 h-10 bg-transparent dark:bg-slate-900 dark:text-slate-200 rounded outline-none border border-gray-200 focus:border-indigo-600 dark:border-gray-800 dark:focus:border-indigo-600 focus:ring-0",placeholder:"name@example.com",name:"email",required:!0})]}),(0,u.jsxs)("div",{className:"mb-4",children:[(0,u.jsx)("label",{className:"font-semibold",htmlFor:"LoginPassword",children:"Password:"}),(0,u.jsx)("input",{id:"LoginPassword",type:"password",className:"form-input mt-3 w-full py-2 px-3 h-10 bg-transparent dark:bg-slate-900 dark:text-slate-200 rounded outline-none border border-gray-200 focus:border-indigo-600 dark:border-gray-800 dark:focus:border-indigo-600 focus:ring-0",placeholder:"Password:",name:"password",required:!0})]}),(0,u.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,u.jsxs)("div",{className:"flex items-center mb-0",children:[(0,u.jsx)("input",{className:"form-checkbox rounded border-gray-200 dark:border-gray-800 text-indigo-600 focus:border-indigo-300 focus:ring focus:ring-offset-0 focus:ring-indigo-200 focus:ring-opacity-50 me-2",type:"checkbox",value:"",name:"remember",id:"RememberMe",required:!0}),(0,u.jsx)("label",{className:"form-checkbox-label text-slate-400",htmlFor:"RememberMe",children:"Remember me"})]}),(0,u.jsx)("p",{className:"text-slate-400 mb-0",children:(0,u.jsx)(o.rU,{to:"/forgot-password",className:"text-slate-400",children:"Forgot password ?"})})]}),(0,u.jsx)("div",{className:"mb-4",children:(0,u.jsx)("button",{type:"submit",className:"py-2 px-5 inline-block font-semibold tracking-wide border align-middle duration-500 text-base text-center bg-indigo-600 hover:bg-indigo-700 border-indigo-600 hover:border-indigo-700 text-white rounded-md w-full",children:"Login"})}),(0,u.jsxs)("div",{className:"text-center",children:[(0,u.jsx)("span",{className:"text-slate-400 me-2",children:"Don't have an account ?"})," ",(0,u.jsx)(o.rU,{to:"/signup",className:"text-black dark:text-white font-bold inline-block",children:"Sign Up"})]})]})}),(0,u.jsx)(y,{})]})})})]})})}},1461:()=>{}}]);
//# sourceMappingURL=534.5986962e.chunk.js.map