Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.133.148.222
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/ChangePassword-DB6VXlfL.js |
import{v,E as h,x as F,r as t,t as e,D as H,L as K,B as w,F as u,aC as A,aD as b,M as $}from"./index-D7ghdVBa.js";import{S as G}from"./index-Bip1AesS.js";import{R as i,C as c}from"./row-BdYVGbEy.js";import"./responsiveObserver-Dqu-tqCp.js";const Y=(a,r,x,o,m,l,p)=>async(n,y)=>{try{const g=y();let f=localStorage.getItem("dbname");n({type:"SET_LOADER"});const d=await v.get("/app.php?a=getOtpForChangePwd&db="+f+"&username="+a+"&userid="+r+"&mobile="+x+"&univcode="+o+"&usertype="+m+"&univname="+l+"&oldpassword="+p);n({type:"UNSET_LOADER"}),d.data.error_code===0?n({type:"VALIDATE_PASSWORD",payload:!0}):(n({type:"VALIDATE_PASSWORD",payload:!1}),h("info",d.data.data.msg))}catch(g){console.log("error",g.message)}},q=(a,r,x,o,m,l,p)=>async(n,y)=>{try{const g=y();let f=localStorage.getItem("dbname");n({type:"SET_LOADER"});const d=await v.get("/app.php?a=checkOtpToChangePwd&db="+f+"&eotp="+a+"&username="+r+"&userid="+x+"&mobile="+o+"&univcode="+m+"&usertype="+l+"&univname="+p);n({type:"UNSET_LOADER"}),d.data.error_code===0?(n({type:"CHECK_PASSWORD",payload:!0}),n({type:"VALIDATE_PASSWORD",payload:!1}),h("success",d.data.data.msg)):(n({type:"CHECK_PASSWORD",payload:!1}),n({type:"VALIDATE_PASSWORD",payload:!0}),h("info",d.data.data.msg))}catch(g){console.log("error",g.message)}},z=a=>async(r,x)=>{try{const o=x();let m=localStorage.getItem("dbname");r({type:"SET_LOADER"});const l=await v.post("app.php?a=toSaveNewPassword&db="+m,a);r({type:"UNSET_LOADER"}),l.data.error_code===0?h("success",l.data.data.msg):h("info",l.data.data.msg)}catch(o){console.log("error",o.message)}},J=a=>{const[r,x]=t.useState(""),[o,m]=t.useState(""),[l,p]=t.useState(""),[n,y]=t.useState(!0);t.useState(!0);const[g,f]=t.useState(!1),[d,C]=t.useState(""),[j,R]=t.useState(""),[L,S]=t.useState(!1),[P,_]=t.useState(""),[E,T]=t.useState(""),[D,I]=t.useState({});t.useEffect(()=>{x(a.username),m(a.userid),p(a.usermobile)},[]),t.useEffect(()=>{I(a.oldPwd),a.oldPwd.validate&&S(!0),a.oldPwd.check&&S(!1)},[a.oldPwd]);const k=async()=>{if(j==""){h("Enter Your Old Password");return}else await a.getOtp(r,o,l,a.univcode,a.usertype,a.univname,j)},B=async s=>{C(s),await a.checkOpt(s,r,o,l,a.univcode,a.usertype,a.univname,a.changepwd),f(!0),y(!1)},N=s=>{C(s)},U=s=>{R(s)},O=()=>{S(!1)},M=s=>{_(s)},V=s=>{T(s)},W=async()=>{if(P==E){const s=new FormData;s.append("newPass",P),s.append("username",a.username),s.append("userid",a.userid),s.append("mobile",a.usermobile),s.append("univcode",a.univcode),s.append("usertype",a.usertype),s.append("univname",a.univname),await a.toChangePassword(s)}};return e.jsxs(H,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Change Password"}),extra:e.jsx(G,{children:e.jsx(K,{to:"/",children:e.jsx(w,{type:"primary",danger:!0,children:"Exit"})})}),children:[e.jsx(i,{children:e.jsxs(c,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"User Name"}),e.jsx(u,{style:{marginBottom:"10px"},value:r,disabled:!0})]})}),e.jsx(i,{children:e.jsxs(c,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"User Id"}),e.jsx(u,{style:{marginBottom:"10px"},value:o,disabled:!0})]})}),e.jsx(i,{children:e.jsxs(c,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Mobile No"}),e.jsx(u,{style:{marginBottom:"10px"},prefix:e.jsx(A,{}),value:l,disabled:!0})]})}),e.jsx(i,{children:e.jsxs(c,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Old Password"}),e.jsx(u.Password,{style:{marginBottom:"10px"},value:j,prefix:e.jsx(b,{}),maxLength:32,onChange:s=>{U(s.target.value)}})]})}),!D.check&&e.jsx(i,{children:e.jsx(w,{type:"primary",style:{marginBottom:"10px"},onClick:()=>{k()},children:"Get OTP"})}),e.jsx($,{visible:L,onCancel:O,footer:[e.jsx(w,{onClick:O,children:"Cancel"},"cancel"),e.jsx(w,{type:"primary",onClick:()=>B(d),children:"Submit"},"submit")],children:e.jsx(i,{children:e.jsxs(c,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Enter OTP"}),e.jsx(u,{style:{marginBottom:"10px"},value:d,maxLength:6,prefix:e.jsx(A,{}),onChange:s=>N(s.target.value)})]})})}),D.check&&e.jsxs(e.Fragment,{children:[e.jsx(i,{children:e.jsxs(c,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"New Password"}),e.jsx(u.Password,{style:{marginBottom:"10px"},value:P,prefix:e.jsx(b,{}),maxLength:32,onChange:s=>M(s.target.value)})]})}),e.jsx(i,{children:e.jsxs(c,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Confirm Password"}),e.jsx(u.Password,{style:{marginBottom:"10px"},value:E,prefix:e.jsx(b,{}),maxLength:32,onChange:s=>V(s.target.value)})]})}),e.jsx(i,{children:e.jsx(c,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:e.jsx(w,{type:"primary",onClick:()=>W(),children:"Save"})})})]})]})},Q=a=>(console.log(a.oldPwd,"hiiiiii"),{username:a.loginfo.userData.fteachname,userid:a.loginfo.userData.fregno,usermobile:a.loginfo.userData.fmobile,univcode:a.loginfo.userData.funivcode,usertype:a.loginfo.userData.fusertype,univname:a.loginfo.userData.funivname,changepwd:a.changepwd,oldPwd:a.oldPwd}),se=F(Q,{getOtp:Y,checkOpt:q,toChangePassword:z})(J);export{se as default};
|