0xV3NOMx
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.140.195.205


Current Path : /var/www/qptran/static/js/
Upload File :
Current File : /var/www/qptran/static/js/35.e1e7b81d.chunk.js.map

{"version":3,"sources":["app/login/index.js"],"names":["Login","props","history","useHistory","match","path","localStorage","setItem","useState","univName","setUnivName","useEffect","API","get","getItem","headers","res","data","FUNIVNAME","console","log","loaduniv","username","setusername","paswword","setpassword","handleSubmit","Swal","fire","error_code","token","loginfo","push","msg","logo","style","backgroundColor","borderRadius","width","height","className","src","require","alt","color","display","marginRight","paddingLeft","paddingRight","fontSize","textAlign","Group","Input","type","onChange","e","value","placeholder","onClick"],"mappings":"2gNA6LeA,UAtLD,SAACC,GACb,IAAMC,EAAUC,cACQ,QAApBF,EAAMG,MAAMC,KACdC,aAAaC,QAAQ,WAAY,OACJ,SAApBN,EAAMG,MAAMC,KACrBC,aAAaC,QAAQ,WAAY,OACJ,SAApBN,EAAMG,MAAMC,MACrBC,aAAaC,QAAQ,WAAY,OAGnC,MAAgCC,mBAAS,IAAzC,mBAAOC,EAAP,KAAiBC,EAAjB,KAEAC,qBAAU,YACM,uCAAG,6GAEKC,IAAIC,IAAJ,yCACkBP,aAAaQ,QAAQ,aACvD,CACEC,QAAS,CACP,cAAe,cANR,OAEPC,EAFO,OAUbN,EAAYM,EAAIC,KAAKA,KAAKC,WAVb,gDAYbC,QAAQC,IAAR,MAZa,yDAAH,qDAgBdC,KACC,IAEH,MAAgCb,mBAAS,IAAzC,mBAAOc,EAAP,KAAiBC,EAAjB,KACA,EAAgCf,mBAAS,IAAzC,mBAAOgB,EAAP,KAAiBC,EAAjB,KAEMC,EAAY,uCAAG,uFACH,IAAZJ,EADe,uBAEjBK,IAAKC,KAAK,mBAFO,6BAMH,IAAZJ,EANe,uBAOjBG,IAAKC,KAAK,kBAPO,iCAUnBT,QAAQC,IAAI,aAAcd,aAAaQ,QAAQ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uBACEb,MAAO,CACLC,gBAAiB,gBACjBQ,MAAO,QACPK,SAAU,OACVC,UAAW,WALf,SAUA,kBAAC,IAAD,CAAMV,UAAU,OACd,kBAAC,IAAKW,MAAN,KACE,kBAAC,IAAKC,MAAN,CACEC,KAAK,QACLC,SAAU,SAACC,EAAGtC,GACZM,EAAYN,EAAKuC,QAEnBA,MAAOlC,EACPa,MAAO,CAAEG,MAAO,SAChBmB,YAAY,WACZjB,UAAU,YAGd,kBAAC,IAAKW,MAAN,CAAYX,UAAU,UACpB,kBAAC,IAAKY,MAAN,CACEC,KAAK,WACLC,SAAU,SAACC,EAAGtC,GACZQ,EAAYR,EAAKuC,QAEnBA,MAAOhC,EACPW,MAAO,CAAEG,MAAO,SAChBmB,YAAY,WACZjB,UAAU,YAGd,yBAAKA,UAAU,QACb,kBAAC,IAAD,CACEA,UAAU,wDACVkB,QAAS,kBAAMhC,KACfS,MAAO,CAAEC,gBAAiB,gBAAiBQ,MAAO,UAHpD","file":"static/js/35.e1e7b81d.chunk.js","sourcesContent":["import React, { Component, useState, useEffect } from \"react\";\nimport { Link, useHistory } from \"react-router-dom\";\n// import { Form } from 'react-bootstrap';\nimport { Form } from \"semantic-ui-react\";\nimport API from \"../api/apilink\";\nimport Swal from \"sweetalert2\";\n\nconst Login = (props) => {\n  const history = useHistory();\n  if (props.match.path == \"/bcu\") {\n    localStorage.setItem(\"univcode\", \"041\");\n  } else if (props.match.path == \"/rcub\") {\n    localStorage.setItem(\"univcode\", \"027\");\n  } else if (props.match.path == \"/demo\") {\n    localStorage.setItem(\"univcode\", \"098\");\n  }\n\n  const [univName, setUnivName] = useState(\"\");\n\n  useEffect(() => {\n    const loaduniv = async function () {\n      try {\n        const res = await API.get(\n          `app.php?a=getUnivName&univcode=${localStorage.getItem(\"univcode\")}`,\n          {\n            headers: {\n              \"X-Auth-Type\": \"LOADUNIV\",\n            },\n          }\n        );\n        setUnivName(res.data.data.FUNIVNAME);\n      } catch (err) {\n        console.log(err);\n      }\n    };\n\n    loaduniv();\n  }, []);\n\n  const [username, setusername] = useState(\"\");\n  const [paswword, setpassword] = useState(\"\");\n\n  const handleSubmit = async () => {\n    if (username == \"\") {\n      Swal.fire(\"Enter User Name\");\n      return;\n    }\n\n    if (paswword == \"\") {\n      Swal.fire(\"Enter Password\");\n      return;\n    }\n    console.log(\"hkjhkjhk: \", localStorage.getItem(\"univcode\"));\n    try {\n      const res = await API.get(\n        `app.php?a=qptranvaliddate&univcode=${localStorage.getItem(\n          \"univcode\"\n        )}&username=${username}&paswword=${paswword}`,\n        {\n          headers: {\n            \"X-Auth-Type\": \"LOGREGN\",\n          },\n        }\n      );\n      if (res.data.error_code == 0) {\n        localStorage.setItem(\"token\", res.data.data.token);\n        localStorage.setItem(\"collcode\", res.data.data.loginfo[\"fcollcode\"]);\n        localStorage.setItem(\"user\", res.data.data.loginfo[\"fuser\"]);\n        localStorage.setItem(\"usertype\", res.data.data.loginfo[\"fusertype\"]);\n        localStorage.setItem(\"name\", res.data.data.loginfo[\"fname\"]);\n        localStorage.setItem(\"mob\", res.data.data.loginfo[\"fmobileno\"]);\n        if (localStorage.getItem(\"usertype\") == \"A\") {\n          history.push(\"/dashboard\");\n        } else {\n          history.push(\"/dashboardcollege\");\n        }\n      } else {\n        Swal.fire(res.data.data.msg);\n        return;\n      }\n    } catch (err) {\n      console.log(err);\n    }\n  };\n\n  const handleKeyPress = (e) => {\n    if (e.key === \"Enter\") {\n      console.log(\"enter press here! \");\n    }\n  };\n\n  let logo = localStorage.getItem(\"univcode\");\n\n  return (\n    <div\n      style={{\n        backgroundColor: \"white\",\n        borderRadius: \"10px\",\n        width: \"100%\",\n        height: \"100%\",\n      }}\n    >\n      <div>\n        <div className=\"brand-logo\">\n          <img\n            src={require(`../../assets/images/${logo}.jpg`)}\n            alt=\"logo\"\n            style={{ width: \"120px\", height: \"100px\" }}\n          />\n          <b style={{ color: \"#0763c5\" }}>{univName}</b>\n        </div>\n        <hr />\n        <div style={{ display: \"flex\" }}>\n          <div\n            className=\"col-lg-7\"\n            style={{\n              marginRight: \"5px\",\n              paddingLeft: \"0px\",\n              paddingRight: \"0px\",\n            }}\n          >\n            <p\n              style={{\n                backgroundColor: \"rgb(7 99 197)\",\n                color: \"white\",\n                fontSize: \"16px\",\n                textAlign: \"center\",\n              }}\n            >\n              Notification\n            </p>\n            <div></div>\n          </div>\n          <div\n            className=\"col-lg-5 pr-1\"\n            style={{ paddingLeft: \"0px\", paddingRight: \"0px\" }}\n          >\n            <p\n              style={{\n                backgroundColor: \"rgb(7 99 197)\",\n                color: \"white\",\n                fontSize: \"16px\",\n                textAlign: \"center\",\n              }}\n            >\n              Login\n            </p>\n            <Form className=\"p-5\">\n              <Form.Group>\n                <Form.Input\n                  type=\"email\"\n                  onChange={(e, data) => {\n                    setusername(data.value);\n                  }}\n                  value={username}\n                  style={{ width: \"476px\" }}\n                  placeholder=\"Username\"\n                  className=\"h-auto\"\n                />\n              </Form.Group>\n              <Form.Group className=\"d-flex\">\n                <Form.Input\n                  type=\"password\"\n                  onChange={(e, data) => {\n                    setpassword(data.value);\n                  }}\n                  value={paswword}\n                  style={{ width: \"476px\" }}\n                  placeholder=\"Password\"\n                  className=\"h-auto\"\n                />\n              </Form.Group>\n              <div className=\"mt-3\">\n                <Link\n                  className=\"btn btn-block btn-lg font-weight-medium auth-form-btn\"\n                  onClick={() => handleSubmit()}\n                  style={{ backgroundColor: \"rgb(7 99 197)\", color: \"white\" }}\n                >\n                  SIGN IN\n                </Link>\n              </div>\n            </Form>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n};\n\nexport default Login;\n"],"sourceRoot":""}