Commit 4ffc80d1 by letrongtri99

checkin_update

parent 1b47ea78
{
"files": {
"main.css": "/static/css/main.add30b4c.chunk.css",
"main.js": "/static/js/main.63a9d8be.chunk.js",
"main.js.map": "/static/js/main.63a9d8be.chunk.js.map",
"main.js": "/static/js/main.d29c9c84.chunk.js",
"main.js.map": "/static/js/main.d29c9c84.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.22042a8f.js",
"runtime-main.js.map": "/static/js/runtime-main.22042a8f.js.map",
"static/js/2.54a2d91d.chunk.js": "/static/js/2.54a2d91d.chunk.js",
......@@ -17,6 +17,6 @@
"static/js/runtime-main.22042a8f.js",
"static/js/2.54a2d91d.chunk.js",
"static/css/main.add30b4c.chunk.css",
"static/js/main.63a9d8be.chunk.js"
"static/js/main.d29c9c84.chunk.js"
]
}
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/logoDCV_2.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo-DCV.png"/><link rel="manifest" href="/manifest.json"/><title>HRM CheckIn</title><link href="/static/css/main.add30b4c.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"46ba7ee0"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpcheckin_dcv=this.webpackJsonpcheckin_dcv||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/static/js/2.54a2d91d.chunk.js"></script><script src="/static/js/main.63a9d8be.chunk.js"></script></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/logoDCV_2.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo-DCV.png"/><link rel="manifest" href="/manifest.json"/><title>HRM CheckIn</title><link href="/static/css/main.add30b4c.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"46ba7ee0"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpcheckin_dcv=this.webpackJsonpcheckin_dcv||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/static/js/2.54a2d91d.chunk.js"></script><script src="/static/js/main.d29c9c84.chunk.js"></script></body></html>
\ No newline at end of file
{"version":3,"sources":["api/api.js","api/user.js","View/Login/LoginScreen.js","View/Home/ButtonCheckIn.js","View/Home/HomeView.js","View/Home/HomeContainer.js","View/RootView.js","App.js","reportWebVitals.js","index.js"],"names":["GetData","url","data","a","token","localStorage","getItem","myRequest","method","headers","Accept","Authorization","params","timeout","console","log","axios","then","response","catch","error","request","message","status","PostLogin","json","JSON","stringify","PostData","defaults","loginApi","body","res","err","checkInApi","checkOutApi","statusCheckIn","Copyright","Typography","variant","color","align","Link","href","Date","getFullYear","useStyles","makeStyles","theme","paper","display","flexDirection","alignItems","avatar","margin","spacing","backgroundColor","palette","secondary","main","form","width","submit","LoginScreen","classes","history","useHistory","useState","appcode","username","password","state","setState","helperText","sethelperText","onLogin","errorCode","setItem","accessToken","name","fullName","code","push","pathname","style","height","Container","component","maxWidth","CssBaseline","className","marginTop","marginBottom","src","TextField","required","fullWidth","label","autoComplete","onChange","e","target","value","autoFocus","type","FormHelperText","marginLeft","fontSize","Button","onClick","Grid","container","item","xs","Box","mt","styles","bounce","animation","animationName","Radium","keyframes","bounceIn","animationDuration","HomeView","React","Component","props","user","onCheckIn","changeStatus","changeIdCheck","setStatus","useEffect","getInfo","empCode","parse","notCheckInYet","notCheckOutYet","checkInID","doneCheck","removeItem","setTimeout","window","alert","fixed","textAlign","justifyContent","Fab","aria-label","HomeContainer","useLocation","latitude","longitude","setChangeStatus","changeId","setChangeId","setUser","infoUser","getPosition","navigator","geolocation","getCurrentPosition","position","coords","employeeCode","companyCode","checkinId","lat","lng","deviceName","deviceMac","id","RootView","PrivateRoute","children","rest","render","location","to","from","PublicRoute","exact","path","App","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","StrictMode","document","getElementById"],"mappings":"gYAGO,SAAeA,EAAtB,oC,4CAAO,WAAuBC,EAAKC,GAA5B,iBAAAC,EAAA,6DACCC,EAAQC,aAAaC,QAAQ,aAC/BC,EAAY,CACdC,OAAQ,MACRP,MACAQ,QAAS,CACPC,OAAQ,mBACR,eAAgB,mBAChBC,cAAe,UAAYP,GAE7BQ,OAAO,eACFV,GAELW,QAAS,KAGXC,QAAQC,IAAI,aAAcR,GAhBrB,SAiBQS,IAAMT,GAChBU,MAAK,SAACC,GAAD,OAAcA,KACnBD,MAAK,SAACC,GAAD,OAAcA,KACnBC,OAAM,SAACC,GAMN,OALAN,QAAQC,IAAIK,EAAMC,SACN,CACVC,QAAS,QACTC,OAAQH,EAAMC,QAAQE,WAxBvB,oF,sBA6BA,SAAeC,EAAtB,oC,4CAAO,WAAyBvB,EAAKwB,GAA9B,2BAAAtB,EAAA,+FACDI,EAAY,CACdC,OAAQ,OACRP,MACAQ,QAAS,CACPC,OAAQ,mBACR,eAAgB,oBAElBG,QAAS,IACTX,KAAMwB,KAAKC,UA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EAAQ,4BACtClG,EAAczE,aAAaC,QAAQ,aACvC,OACE,cAAC,IAAD,2BACM0K,GADN,IAEEC,OAAQ,gBAAGC,EAAH,EAAGA,SAAH,OACLpG,EAGC,cAAC,IAAD,CACEqG,GAAI,CACFhG,SAAU,QACVZ,MAAO,CAAE6G,KAAMF,MALnBH,MAaV,OACE,cAAC,IAAD,UACE,eAAC,IAAD,WACE,cAACM,EAAD,CAAaC,OAAK,EAACC,KAAK,IAAxB,SACE,cAAC,EAAD,MAEF,cAACT,EAAD,CAAcS,KAAK,QAAnB,SACE,cAAC,EAAD,YClDKC,MAJf,WACE,OAAO,cAAC,EAAD,KCQMC,GAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,8BAAqB1K,MAAK,YAAkD,IAA/C2K,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAAShB,OACP,cAAC,IAAMiB,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1BX,O","file":"static/js/main.63a9d8be.chunk.js","sourcesContent":["import axios from \"axios\";\r\naxios.defaults.timeout = 10000;\r\n\r\nexport async function GetData(url, data) {\r\n const token = localStorage.getItem(\"TOKEN_KEY\");\r\n let myRequest = {\r\n method: \"get\",\r\n url,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n Authorization: \"Bearer \" + token,\r\n },\r\n params: {\r\n ...data,\r\n },\r\n timeout: 60 * 1000,\r\n // withCredentials: true,\r\n };\r\n console.log(\"My request\", myRequest);\r\n return await axios(myRequest)\r\n .then((response) => response)\r\n .then((response) => response)\r\n .catch((error) => {\r\n console.log(error.request);\r\n const err = {\r\n message: \"error\",\r\n status: error.request.status,\r\n };\r\n return err;\r\n });\r\n}\r\nexport async function PostLogin(url, json, isAuth = true) {\r\n let myRequest = {\r\n method: \"post\",\r\n url,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n },\r\n timeout: 60 * 1000,\r\n data: JSON.stringify(json),\r\n };\r\n console.log(\"post data mobile\", myRequest);\r\n return await axios(myRequest)\r\n .then((response) => response)\r\n .then((response) => response)\r\n .catch((error) => {\r\n console.log(error.request);\r\n const err = {\r\n message: \"error\",\r\n status: error.request.status,\r\n };\r\n return err;\r\n });\r\n}\r\n\r\nexport async function PostData(url, json, isAuth = true) {\r\n const token = localStorage.getItem(\"TOKEN_KEY\");\r\n let myRequest = {\r\n method: \"post\",\r\n url,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n Authorization: \"Bearer \" + token,\r\n },\r\n timeout: 60 * 1000,\r\n data: JSON.stringify(json),\r\n };\r\n console.log(\"post data mobile\", myRequest);\r\n return await axios(myRequest)\r\n .then((response) => response)\r\n .then((response) => response)\r\n .catch((error) => {\r\n console.log(error.request);\r\n const err = {\r\n message: \"error\",\r\n status: error.request.status,\r\n };\r\n return err;\r\n });\r\n}\r\n","import { GetData, PostLogin, PostData } from \"./api\";\r\n\r\nexport const loginApi = async (body) =>\r\n PostLogin(\"http://hrm.auth.dcv.vn/api/v1/auth/login\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n\r\nexport const getDataApi = async (body) =>\r\n GetData(\"http://hrm.auth.dcv.vn/api/v1/auth/login\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n\r\nexport const checkInApi = async (body) =>\r\n PostData(\"http://hrm.japi.dcv.vn/venus-service/checkinService/checkin\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n\r\nexport const checkOutApi = async (body) =>\r\n PostData(\"http://hrm.japi.dcv.vn/venus-service/checkinService/checkout\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n\r\nexport const statusCheckIn = async (body) =>\r\n GetData(\"http://hrm.api.dcv.vn/api/v1/checkin/personaldailycheckin\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n","import React, { useState } from \"react\";\r\nimport Avatar from \"@material-ui/core/Avatar\";\r\nimport Button from \"@material-ui/core/Button\";\r\nimport CssBaseline from \"@material-ui/core/CssBaseline\";\r\nimport TextField from \"@material-ui/core/TextField\";\r\nimport { FormHelperText, Link, Grid, Box, Typography } from \"@material-ui/core\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport LockOutlinedIcon from \"@material-ui/icons/LockOutlined\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport Container from \"@material-ui/core/Container\";\r\nimport { loginApi } from \"../../api/user\";\r\n\r\nfunction Copyright() {\r\n return (\r\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\r\n {\"Copyright © \"}\r\n <Link color=\"inherit\" href=\"https://material-ui.com/\">\r\n Your Website\r\n </Link>{\" \"}\r\n {new Date().getFullYear()}\r\n {\".\"}\r\n </Typography>\r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n paper: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n alignItems: \"center\",\r\n },\r\n avatar: {\r\n margin: theme.spacing(1),\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n form: {\r\n width: \"100%\", // Fix IE 11 issue.\r\n },\r\n submit: {\r\n margin: theme.spacing(3, 0, 2),\r\n },\r\n}));\r\n\r\nconst LoginScreen = () => {\r\n const classes = useStyles();\r\n let history = useHistory();\r\n const [state, setState] = useState({\r\n appcode: \"Dcv\",\r\n username: \"\",\r\n password: \"\",\r\n });\r\n\r\n const [helperText, sethelperText] = useState(\"\");\r\n const onLogin = async () => {\r\n if (state.username === \"\" || state.password === \"\") {\r\n sethelperText(\"\");\r\n sethelperText(\"Cần phải điền đầy đủ email và password\");\r\n } else {\r\n sethelperText(\"\");\r\n const res = await loginApi(state);\r\n\r\n if (res.data && res.data.errorCode === 0) {\r\n localStorage.setItem(\"TOKEN_KEY\", res.data.data.accessToken);\r\n localStorage.setItem(\r\n \"user\",\r\n JSON.stringify({\r\n name: res.data.data.fullName,\r\n code: res.data.data.code,\r\n })\r\n );\r\n history.push({\r\n pathname: \"/home\",\r\n state: { code: res.data.data.code, fullName: res.data.data.fullName },\r\n });\r\n } else if (res.data && res.data.errorCode === 1) {\r\n sethelperText(\"\");\r\n sethelperText(\"Sai email hoặc mật khẩu\");\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <div style={{ height: \"100vh\" }}>\r\n <Container component=\"main\" maxWidth=\"xs\">\r\n <CssBaseline />\r\n <div className={classes.paper}>\r\n <img\r\n style={{ width: 200, height: 100, marginTop: 10, marginBottom: 10 }}\r\n src=\"/logo-DCV.png\"\r\n />\r\n <Typography color={\"primary\"} component=\"h1\" variant=\"h5\">\r\n ĐĂNG NHẬP\r\n </Typography>\r\n <TextField\r\n variant=\"outlined\"\r\n margin=\"normal\"\r\n required\r\n fullWidth\r\n label=\"Email\"\r\n autoComplete=\"email\"\r\n onChange={(e) => {\r\n setState({\r\n ...state,\r\n username: e.target.value,\r\n });\r\n }}\r\n autoFocus\r\n />\r\n <TextField\r\n variant=\"outlined\"\r\n margin=\"normal\"\r\n required\r\n fullWidth\r\n label=\"Mật khẩu\"\r\n type=\"password\"\r\n onChange={(e) => {\r\n setState({\r\n ...state,\r\n password: e.target.value,\r\n });\r\n }}\r\n autoComplete=\"current-password\"\r\n />\r\n <div style={{ width: \"100%\" }}>\r\n <FormHelperText\r\n style={{ marginLeft: \"16px\", color: \"red\", fontSize: \"13px\" }}\r\n >\r\n {helperText}\r\n </FormHelperText>\r\n </div>\r\n\r\n <Button\r\n type=\"submit\"\r\n fullWidth\r\n variant=\"contained\"\r\n color=\"primary\"\r\n className={classes.submit}\r\n onClick={onLogin}\r\n >\r\n Đăng nhập\r\n </Button>\r\n <Grid container>\r\n <Grid item xs>\r\n <Link href=\"#\" variant=\"body2\">\r\n Quên mật khẩu?\r\n </Link>\r\n </Grid>\r\n </Grid>\r\n </div>\r\n <Box mt={8}>\r\n <Copyright />\r\n </Box>\r\n </Container>\r\n </div>\r\n );\r\n};\r\n\r\nexport default LoginScreen;\r\n","import React from \"react\";\r\nimport { bounce, fadeIn, bounceIn } from \"react-animations\";\r\nimport Radium, { StyleRoot } from \"radium\";\r\n\r\nconst styles = {\r\n bounce: {\r\n animation: \"x 1s\",\r\n animationName: Radium.keyframes(bounceIn, \"bounceIn\"),\r\n animationDuration: \"10s\",\r\n },\r\n};\r\n\r\nclass ButtonCheckIn extends React.Component {\r\n render() {\r\n return (\r\n <StyleRoot>\r\n <div className=\"test\" style={styles.bounce}>\r\n aaa\r\n </div>\r\n </StyleRoot>\r\n );\r\n }\r\n}\r\n\r\nexport default ButtonCheckIn;\r\n","import React, { useState, useEffect } from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n Container,\r\n Grid,\r\n Paper,\r\n Card,\r\n Typography,\r\n Fab,\r\n Button,\r\n} from \"@material-ui/core\";\r\nimport { statusCheckIn } from \"../../api/user\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport Alert from \"@material-ui/lab/Alert\";\r\nimport \"./HomeView.css\";\r\n\r\nimport ButtonCheckIn from \"./ButtonCheckIn\";\r\n\r\nconst HomeView = (props) => {\r\n const { user, onCheckIn, changeStatus, changeIdCheck } = props;\r\n\r\n const [status, setStatus] = useState(\"\");\r\n let history = useHistory();\r\n\r\n useEffect(() => {\r\n getInfo();\r\n }, [changeStatus]);\r\n\r\n const getInfo = async () => {\r\n const res = await statusCheckIn({\r\n empCode: JSON.parse(localStorage.getItem(\"user\")).code,\r\n });\r\n if (res.data && res.data.errorCode == 0) {\r\n if (res.data.data.notCheckInYet == 1) {\r\n setStatus(0);\r\n } else if (res.data.data.notCheckOutYet == 1) {\r\n setStatus(1);\r\n changeIdCheck(res.data.data.checkInID);\r\n } else if (res.data.data.doneCheck == 1) {\r\n setStatus(2);\r\n }\r\n } else if (res.status == 403 || res.status == 401) {\r\n localStorage.removeItem(\"TOKEN_KEY\");\r\n localStorage.removeItem(\"user\");\r\n setTimeout(() => {\r\n history.push(\"/\");\r\n }, 100);\r\n } else {\r\n window.alert(\"Lỗi\");\r\n }\r\n };\r\n\r\n const signOut = () => {\r\n localStorage.removeItem(\"TOKEN_KEY\");\r\n localStorage.removeItem(\"user\");\r\n setTimeout(() => {\r\n history.push(\"/\");\r\n }, 100);\r\n };\r\n return (\r\n <Container fixed style={{ height: \"100vh\" }}>\r\n <div style={{ marginTop: 80, height: \"10px\" }} />\r\n <div style={{ textAlign: \"center\", fontSize: \"35px\", marginTop: \"15px\" }}>\r\n <Typography variant={\"h4\"} style={{ color: \" #3399ff\" }}>\r\n Chào mừng\r\n </Typography>\r\n <h6 style={{ fontSize: \"30px\", margin: \"0px\", color: \" #3399ff\" }}>\r\n {user ? user.name : \"\"}\r\n </h6>\r\n </div>\r\n <br />\r\n <Grid container style={{ height: \"30vh\", justifyContent: \"center\" }}>\r\n <Fab\r\n aria-label=\"edit\"\r\n style={{ width: \"30vw\", height: \"30vw\" }}\r\n onClick={() => {\r\n onCheckIn(status);\r\n }}\r\n className={\r\n status == 0 ? \"checkin\" : status == 1 ? \"checkout\" : \"complete\"\r\n }\r\n >\r\n <span style={{ fontSize: \"3vw\" }}>\r\n {status == 0\r\n ? \"CHECK-IN\"\r\n : status == 1\r\n ? \"CHECK-OUT\"\r\n : \"Hoàn thành\"}\r\n </span>\r\n </Fab>\r\n </Grid>\r\n <div style={{ textAlign: \"center\" }}>\r\n <Button variant=\"contained\" color=\"secondary\" onClick={signOut}>\r\n Đăng xuất\r\n </Button>\r\n </div>\r\n </Container>\r\n );\r\n};\r\n\r\nexport default HomeView;\r\n","import React, { useState, useEffect } from \"react\";\r\nimport HomeView from \"./HomeView\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { checkInApi, checkOutApi } from \"../../api/user\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport Alert from \"@material-ui/lab/Alert\";\r\n\r\nconst HomeContainer = (props) => {\r\n const location = useLocation();\r\n\r\n const [state, setState] = useState({\r\n latitude: null,\r\n longitude: null,\r\n });\r\n const [changeStatus, setChangeStatus] = useState(\"\");\r\n const [changeId, setChangeId] = useState(\"\");\r\n\r\n const [user, setUser] = useState({});\r\n let history = useHistory();\r\n\r\n const changeIdCheck = (id) => {\r\n setChangeId(id);\r\n };\r\n\r\n useEffect(() => {\r\n const infoUser = JSON.parse(localStorage.getItem(\"user\"));\r\n setUser(infoUser);\r\n getPosition();\r\n }, []);\r\n\r\n const getPosition = () => {\r\n navigator.geolocation.getCurrentPosition((position) => {\r\n if (position.coords.longitude)\r\n setState({\r\n latitude: position.coords.latitude,\r\n longitude: position.coords.longitude,\r\n });\r\n });\r\n };\r\n\r\n const onCheckIn = async (status) => {\r\n if (status == 0) {\r\n let res = await checkInApi({\r\n employeeCode: user.code,\r\n companyCode: \"DCV\",\r\n checkinId: null,\r\n lat: \"20.99847600\",\r\n lng: \"105.80720300\",\r\n deviceName: \"Xiaomi\",\r\n deviceMac: \"Xiaomi Mac\",\r\n });\r\n if (res.data && res.data.errorCode == 200) {\r\n alert(\"Checkin thành công\");\r\n setChangeStatus(5);\r\n } else if (res.status == 403 || res.status == 401) {\r\n localStorage.removeItem(\"TOKEN_KEY\");\r\n localStorage.removeItem(\"user\");\r\n setTimeout(() => {\r\n history.push(\"/\");\r\n }, 100);\r\n } else {\r\n alert(\"Lỗi thông tin\");\r\n }\r\n } else if (status == 1) {\r\n let res = await checkOutApi({\r\n employeeCode: user.code,\r\n companyCode: \"DCV\",\r\n checkinId: changeId,\r\n lat: \"20.99847600\",\r\n lng: \"105.80720300\",\r\n deviceName: \"Xiaomi\",\r\n deviceMac: \"Xiaomi Mac\",\r\n });\r\n if (res.data && res.data.errorCode == 200) {\r\n alert(\"Checkout thành công\");\r\n setChangeStatus(6);\r\n } else if (res.status == 403 || res.status == 401) {\r\n localStorage.removeItem(\"TOKEN_KEY\");\r\n localStorage.removeItem(\"user\");\r\n setTimeout(() => {\r\n history.push(\"/\");\r\n }, 100);\r\n } else {\r\n alert(\"Lỗi thông tin\");\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <HomeView\r\n user={user}\r\n onCheckIn={onCheckIn}\r\n changeStatus={changeStatus}\r\n changeIdCheck={changeIdCheck}\r\n />\r\n );\r\n};\r\n\r\nexport default HomeContainer;\r\n","import { BrowserRouter, Switch, Route, Link } from \"react-router-dom\";\r\nimport { useHistory, Redirect } from \"react-router-dom\";\r\nimport React, { useEffect, useState } from \"react\";\r\nimport LoginScreen from \"./Login/LoginScreen\";\r\nimport HomeScreen from \"./Home/HomeContainer\";\r\n\r\nconst RootView = () => {\r\n let history = useHistory();\r\n\r\n function PrivateRoute({ children, ...rest }) {\r\n let accessToken = localStorage.getItem(\"TOKEN_KEY\");\r\n return (\r\n <Route\r\n {...rest}\r\n render={({ location }) =>\r\n accessToken ? (\r\n children\r\n ) : (\r\n <Redirect\r\n to={{\r\n pathname: \"/\",\r\n state: { from: location },\r\n }}\r\n />\r\n )\r\n }\r\n />\r\n );\r\n }\r\n\r\n function PublicRoute({ children, ...rest }) {\r\n let accessToken = localStorage.getItem(\"TOKEN_KEY\");\r\n return (\r\n <Route\r\n {...rest}\r\n render={({ location }) =>\r\n !accessToken ? (\r\n children\r\n ) : (\r\n <Redirect\r\n to={{\r\n pathname: \"/home\",\r\n state: { from: location },\r\n }}\r\n />\r\n )\r\n }\r\n />\r\n );\r\n }\r\n return (\r\n <BrowserRouter>\r\n <Switch>\r\n <PublicRoute exact path=\"/\">\r\n <LoginScreen />\r\n </PublicRoute>\r\n <PrivateRoute path=\"/home\">\r\n <HomeScreen />\r\n </PrivateRoute>\r\n </Switch>\r\n </BrowserRouter>\r\n );\r\n};\r\n\r\nexport default RootView;\r\n","import RootView from \"./View/RootView\";\r\nimport HomeContainer from \"./View/Home/HomeContainer\";\r\n\r\nfunction App() {\r\n return <RootView />;\r\n}\r\n\r\nexport default App;\r\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}
\ No newline at end of file
(this.webpackJsonpcheckin_dcv=this.webpackJsonpcheckin_dcv||[]).push([[0],{143:function(e,t,n){},167:function(e,t,n){},250:function(e,t,n){"use strict";n.r(t);var a=n(6),r=n(0),c=n.n(r),o=n(12),i=n.n(o),u=(n(143),n(23)),s=n(72),l=n(13),h=n(35),d=n(10),p=n.n(d),j=n(15),m=n(30),f=n(291),b=n(289),O=n(294),g=n(251),v=n(286),x=n(290),y=n(292),k=n(295),C=n(287),S=n(288),w=n(52),I=n.n(w);function N(e,t){return E.apply(this,arguments)}function E(){return(E=Object(j.a)(p.a.mark((function e(t,n){var a,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=localStorage.getItem("TOKEN_KEY"),r={method:"get",url:t,headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+a},params:Object(u.a)({},n),timeout:6e4},console.log("My request",r),e.next=5,I()(r).then((function(e){return e})).then((function(e){return e})).catch((function(e){return console.log(e.request),{message:"error",status:e.request.status}}));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function T(e,t){return K.apply(this,arguments)}function K(){return(K=Object(j.a)(p.a.mark((function e(t,n){var a,r=arguments;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!(r.length>2&&void 0!==r[2])||r[2],a={method:"post",url:t,headers:{Accept:"application/json","Content-Type":"application/json"},timeout:6e4,data:JSON.stringify(n)},console.log("post data mobile",a),e.next=5,I()(a).then((function(e){return e})).then((function(e){return e})).catch((function(e){return console.log(e.request),{message:"error",status:e.request.status}}));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(e,t){return _.apply(this,arguments)}function _(){return(_=Object(j.a)(p.a.mark((function e(t,n){var a,r,c=arguments;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!(c.length>2&&void 0!==c[2])||c[2],a=localStorage.getItem("TOKEN_KEY"),r={method:"post",url:t,headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+a},timeout:6e4,data:JSON.stringify(n)},console.log("post data mobile",r),e.next=6,I()(r).then((function(e){return e})).then((function(e){return e})).catch((function(e){return console.log(e.request),{message:"error",status:e.request.status}}));case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}I.a.defaults.timeout=1e4;var q=function(){var e=Object(j.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",T("http://hrm.auth.dcv.vn/api/v1/auth/login",t).then((function(e){return e})).catch((function(e){return e})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(){var e=Object(j.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Y("http://hrm.japi.dcv.vn/venus-service/checkinService/checkin",t).then((function(e){return e})).catch((function(e){return e})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=Object(j.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Y("http://hrm.japi.dcv.vn/venus-service/checkinService/checkout",t).then((function(e){return e})).catch((function(e){return e})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=Object(j.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",N("http://hrm.api.dcv.vn/api/v1/checkin/personaldailycheckin",t).then((function(e){return e})).catch((function(e){return e})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function M(){return Object(a.jsxs)(g.a,{variant:"body2",color:"textSecondary",align:"center",children:["Copyright \xa9 ",Object(a.jsx)(v.a,{color:"inherit",href:"https://material-ui.com/",children:"Your Website"})," ",(new Date).getFullYear(),"."]})}var z=Object(C.a)((function(e){return{paper:{display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%"},submit:{margin:e.spacing(3,0,2)}}})),F=function(){var e=z(),t=Object(l.g)(),n=Object(r.useState)({appcode:"Dcv",username:"",password:""}),c=Object(m.a)(n,2),o=c[0],i=c[1],s=Object(r.useState)(""),h=Object(m.a)(s,2),d=h[0],C=h[1],w=function(){var e=Object(j.a)(p.a.mark((function e(){var n;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==o.username&&""!==o.password){e.next=5;break}C(""),C("C\u1ea7n ph\u1ea3i \u0111i\u1ec1n \u0111\u1ea7y \u0111\u1ee7 email v\xe0 password"),e.next=10;break;case 5:return C(""),e.next=8,q(o);case 8:(n=e.sent).data&&0===n.data.errorCode?(localStorage.setItem("TOKEN_KEY",n.data.data.accessToken),localStorage.setItem("user",JSON.stringify({name:n.data.data.fullName,code:n.data.data.code})),t.push({pathname:"/home",state:{code:n.data.data.code,fullName:n.data.data.fullName}})):n.data&&1===n.data.errorCode&&(C(""),C("Sai email ho\u1eb7c m\u1eadt kh\u1ea9u"));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(a.jsx)("div",{style:{height:"100vh"},children:Object(a.jsxs)(S.a,{component:"main",maxWidth:"xs",children:[Object(a.jsx)(b.a,{}),Object(a.jsxs)("div",{className:e.paper,children:[Object(a.jsx)("img",{style:{width:200,height:100,marginTop:10,marginBottom:10},src:"/logo-DCV.png"}),Object(a.jsx)(g.a,{color:"primary",component:"h1",variant:"h5",children:"\u0110\u0102NG NH\u1eacP"}),Object(a.jsx)(O.a,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,label:"Email",autoComplete:"email",onChange:function(e){i(Object(u.a)(Object(u.a)({},o),{},{username:e.target.value}))},autoFocus:!0}),Object(a.jsx)(O.a,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,label:"M\u1eadt kh\u1ea9u",type:"password",onChange:function(e){i(Object(u.a)(Object(u.a)({},o),{},{password:e.target.value}))},autoComplete:"current-password"}),Object(a.jsx)("div",{style:{width:"100%"},children:Object(a.jsx)(x.a,{style:{marginLeft:"16px",color:"red",fontSize:"13px"},children:d})}),Object(a.jsx)(f.a,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",className:e.submit,onClick:w,children:"\u0110\u0103ng nh\u1eadp"}),Object(a.jsx)(y.a,{container:!0,children:Object(a.jsx)(y.a,{item:!0,xs:!0,children:Object(a.jsx)(v.a,{href:"#",variant:"body2",children:"Qu\xean m\u1eadt kh\u1ea9u?"})})})]}),Object(a.jsx)(k.a,{mt:8,children:Object(a.jsx)(M,{})})]})})},L=n(293),B=(n(167),n(91)),W=n(92),H=n(124),P=n(122),X=n(93),V=n(123),G=n(69),Q={bounce:{animation:"x 1s",animationName:V.a.keyframes(X.bounceIn,"bounceIn"),animationDuration:"10s"}},U=(c.a.Component,function(e){var t=e.user,n=e.onCheckIn,c=e.changeStatus,o=e.changeIdCheck,i=Object(r.useState)(""),u=Object(m.a)(i,2),s=u[0],h=u[1],d=Object(l.g)();Object(r.useEffect)((function(){b()}),[c]);var b=function(){var e=Object(j.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J({empCode:JSON.parse(localStorage.getItem("user")).code});case 2:(t=e.sent).data&&0==t.data.errorCode?1==t.data.data.notCheckInYet?h(0):1==t.data.data.notCheckOutYet?(h(1),o(t.data.data.checkInID)):1==t.data.data.doneCheck&&h(2):403==t.status||401==t.status?(localStorage.removeItem("TOKEN_KEY"),localStorage.removeItem("user"),setTimeout((function(){d.push("/")}),100)):window.alert("L\u1ed7i");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(a.jsxs)(S.a,{fixed:!0,style:{height:"100vh"},children:[Object(a.jsx)("div",{style:{marginTop:80,height:"10px"}}),Object(a.jsxs)("div",{style:{textAlign:"center",fontSize:"35px",marginTop:"15px"},children:[Object(a.jsx)(g.a,{variant:"h4",style:{color:" #3399ff"},children:"Ch\xe0o m\u1eebng"}),Object(a.jsx)("h6",{style:{fontSize:"30px",margin:"0px",color:" #3399ff"},children:t?t.name:""})]}),Object(a.jsx)("br",{}),Object(a.jsx)(y.a,{container:!0,style:{height:"30vh",justifyContent:"center"},children:Object(a.jsx)(L.a,{"aria-label":"edit",style:{width:"30vw",height:"30vw"},onClick:function(){n(s)},className:0==s?"checkin":1==s?"checkout":"complete",children:Object(a.jsx)("span",{style:{fontSize:"3vw"},children:0==s?"CHECK-IN":1==s?"CHECK-OUT":"Ho\xe0n th\xe0nh"})})}),Object(a.jsx)("div",{style:{textAlign:"center"},children:Object(a.jsx)(f.a,{variant:"contained",color:"secondary",onClick:function(){localStorage.removeItem("TOKEN_KEY"),localStorage.removeItem("user"),setTimeout((function(){d.push("/")}),100)},children:"\u0110\u0103ng xu\u1ea5t"})})]})}),R=function(e){Object(l.h)();var t=Object(r.useState)({latitude:null,longitude:null}),n=Object(m.a)(t,2),c=(n[0],n[1]),o=Object(r.useState)(""),i=Object(m.a)(o,2),u=i[0],s=i[1],h=Object(r.useState)(""),d=Object(m.a)(h,2),f=d[0],b=d[1],O=Object(r.useState)({}),g=Object(m.a)(O,2),v=g[0],x=g[1],y=Object(l.g)();Object(r.useEffect)((function(){var e=JSON.parse(localStorage.getItem("user"));x(e),k()}),[]);var k=function(){navigator.geolocation.getCurrentPosition((function(e){e.coords.longitude&&c({latitude:e.coords.latitude,longitude:e.coords.longitude})}))},C=function(){var e=Object(j.a)(p.a.mark((function e(t){var n,a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!=t){e.next=7;break}return e.next=3,D({employeeCode:v.code,companyCode:"DCV",checkinId:null,lat:"20.99847600",lng:"105.80720300",deviceName:"Xiaomi",deviceMac:"Xiaomi Mac"});case 3:(n=e.sent).data&&200==n.data.errorCode?(alert("Checkin th\xe0nh c\xf4ng"),s(5)):403==n.status||401==n.status?(localStorage.removeItem("TOKEN_KEY"),localStorage.removeItem("user"),setTimeout((function(){y.push("/")}),100)):alert("L\u1ed7i th\xf4ng tin"),e.next=12;break;case 7:if(1!=t){e.next=12;break}return e.next=10,A({employeeCode:v.code,companyCode:"DCV",checkinId:f,lat:"20.99847600",lng:"105.80720300",deviceName:"Xiaomi",deviceMac:"Xiaomi Mac"});case 10:(a=e.sent).data&&200==a.data.errorCode?(alert("Checkout th\xe0nh c\xf4ng"),s(6)):403==a.status||401==a.status?(localStorage.removeItem("TOKEN_KEY"),localStorage.removeItem("user"),setTimeout((function(){y.push("/")}),100)):alert("L\u1ed7i th\xf4ng tin");case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(a.jsx)(U,{user:v,onCheckIn:C,changeStatus:u,changeIdCheck:function(e){b(e)}})},Z=function(){Object(l.g)();function e(e){var t=e.children,n=Object(s.a)(e,["children"]),r=localStorage.getItem("TOKEN_KEY");return Object(a.jsx)(l.b,Object(u.a)(Object(u.a)({},n),{},{render:function(e){var n=e.location;return r?t:Object(a.jsx)(l.a,{to:{pathname:"/",state:{from:n}}})}}))}function t(e){var t=e.children,n=Object(s.a)(e,["children"]),r=localStorage.getItem("TOKEN_KEY");return Object(a.jsx)(l.b,Object(u.a)(Object(u.a)({},n),{},{render:function(e){var n=e.location;return r?Object(a.jsx)(l.a,{to:{pathname:"/home",state:{from:n}}}):t}}))}return Object(a.jsx)(h.a,{children:Object(a.jsxs)(l.d,{children:[Object(a.jsx)(t,{exact:!0,path:"/",children:Object(a.jsx)(F,{})}),Object(a.jsx)(e,{path:"/home",children:Object(a.jsx)(R,{})})]})})};var $=function(){return Object(a.jsx)(Z,{})},ee=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,298)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,c=t.getLCP,o=t.getTTFB;n(e),a(e),r(e),c(e),o(e)}))};i.a.render(Object(a.jsx)(c.a.StrictMode,{children:Object(a.jsx)($,{})}),document.getElementById("root")),ee()}},[[250,1,2]]]);
//# sourceMappingURL=main.63a9d8be.chunk.js.map
\ No newline at end of file
(this.webpackJsonpcheckin_dcv=this.webpackJsonpcheckin_dcv||[]).push([[0],{143:function(e,t,n){},167:function(e,t,n){},250:function(e,t,n){"use strict";n.r(t);var a=n(6),r=n(0),c=n.n(r),o=n(12),i=n.n(o),u=(n(143),n(23)),s=n(72),l=n(13),h=n(35),d=n(10),p=n.n(d),j=n(15),m=n(30),f=n(291),b=n(289),O=n(294),g=n(251),v=n(286),x=n(290),y=n(292),k=n(295),C=n(287),S=n(288),w=n(52),I=n.n(w);function N(e,t){return E.apply(this,arguments)}function E(){return(E=Object(j.a)(p.a.mark((function e(t,n){var a,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=localStorage.getItem("TOKEN_KEY"),r={method:"get",url:t,headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+a},params:Object(u.a)({},n),timeout:6e4},console.log("My request",r),e.next=5,I()(r).then((function(e){return e})).then((function(e){return e})).catch((function(e){return console.log(e.request),{message:"error",status:e.request.status}}));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function T(e,t){return K.apply(this,arguments)}function K(){return(K=Object(j.a)(p.a.mark((function e(t,n){var a,r=arguments;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!(r.length>2&&void 0!==r[2])||r[2],a={method:"post",url:t,headers:{Accept:"application/json","Content-Type":"application/json"},timeout:6e4,data:JSON.stringify(n)},console.log("post data mobile",a),e.next=5,I()(a).then((function(e){return e})).then((function(e){return e})).catch((function(e){return console.log(e.request),{message:"error",status:e.request.status}}));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(e,t){return _.apply(this,arguments)}function _(){return(_=Object(j.a)(p.a.mark((function e(t,n){var a,r,c=arguments;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!(c.length>2&&void 0!==c[2])||c[2],a=localStorage.getItem("TOKEN_KEY"),r={method:"post",url:t,headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+a},timeout:6e4,data:JSON.stringify(n)},console.log("post data mobile",r),e.next=6,I()(r).then((function(e){return e})).then((function(e){return e})).catch((function(e){return console.log(e.request),{message:"error",status:e.request.status}}));case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}I.a.defaults.timeout=1e4;var q=function(){var e=Object(j.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",T("http://hrm.auth.dcv.vn/api/v1/auth/login",t).then((function(e){return e})).catch((function(e){return e})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(){var e=Object(j.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Y("http://hrm.japi.dcv.vn/venus-service/checkinService/checkin",t).then((function(e){return e})).catch((function(e){return e})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=Object(j.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Y("http://hrm.japi.dcv.vn/venus-service/checkinService/checkout",t).then((function(e){return e})).catch((function(e){return e})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=Object(j.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",N("http://hrm.api.dcv.vn/api/v1/checkin/personaldailycheckin",t).then((function(e){return e})).catch((function(e){return e})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function M(){return Object(a.jsxs)(g.a,{variant:"body2",color:"textSecondary",align:"center",children:["Copyright \xa9 ",Object(a.jsx)(v.a,{color:"inherit",href:"https://material-ui.com/",children:"Your Website"})," ",(new Date).getFullYear(),"."]})}var z=Object(C.a)((function(e){return{paper:{display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%"},submit:{margin:e.spacing(3,0,2)}}})),F=function(){var e=z(),t=Object(l.g)(),n=Object(r.useState)({appcode:"Dcv",username:"",password:""}),c=Object(m.a)(n,2),o=c[0],i=c[1],s=Object(r.useState)(""),h=Object(m.a)(s,2),d=h[0],C=h[1],w=function(){var e=Object(j.a)(p.a.mark((function e(){var n;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==o.username&&""!==o.password){e.next=5;break}C(""),C("C\u1ea7n ph\u1ea3i \u0111i\u1ec1n \u0111\u1ea7y \u0111\u1ee7 email v\xe0 password"),e.next=10;break;case 5:return C(""),e.next=8,q(o);case 8:(n=e.sent).data&&0===n.data.errorCode?(localStorage.setItem("TOKEN_KEY",n.data.data.accessToken),localStorage.setItem("user",JSON.stringify({name:n.data.data.fullName,code:n.data.data.code})),t.push({pathname:"/home",state:{code:n.data.data.code,fullName:n.data.data.fullName}})):n.data&&1===n.data.errorCode&&(C(""),C("Sai email ho\u1eb7c m\u1eadt kh\u1ea9u"));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(a.jsx)("div",{style:{height:"100vh"},children:Object(a.jsxs)(S.a,{component:"main",maxWidth:"xs",children:[Object(a.jsx)(b.a,{}),Object(a.jsxs)("div",{className:e.paper,children:[Object(a.jsx)("img",{style:{width:200,height:100,marginTop:10,marginBottom:10},src:"/logo-DCV.png"}),Object(a.jsx)(g.a,{color:"primary",component:"h1",variant:"h5",children:"\u0110\u0102NG NH\u1eacP"}),Object(a.jsx)(O.a,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,label:"Email",autoComplete:"email",onChange:function(e){i(Object(u.a)(Object(u.a)({},o),{},{username:e.target.value}))},autoFocus:!0}),Object(a.jsx)(O.a,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,label:"M\u1eadt kh\u1ea9u",type:"password",onChange:function(e){i(Object(u.a)(Object(u.a)({},o),{},{password:e.target.value}))},autoComplete:"current-password"}),Object(a.jsx)("div",{style:{width:"100%"},children:Object(a.jsx)(x.a,{style:{marginLeft:"16px",color:"red",fontSize:"13px"},children:d})}),Object(a.jsx)(f.a,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",className:e.submit,onClick:w,children:"\u0110\u0103ng nh\u1eadp"}),Object(a.jsx)(y.a,{container:!0,children:Object(a.jsx)(y.a,{item:!0,xs:!0,children:Object(a.jsx)(v.a,{href:"#",variant:"body2",children:"Qu\xean m\u1eadt kh\u1ea9u?"})})})]}),Object(a.jsx)(k.a,{mt:8,children:Object(a.jsx)(M,{})})]})})},L=n(293),B=(n(167),n(91)),W=n(92),H=n(124),P=n(122),X=n(93),V=n(123),G=n(69),Q={bounce:{animation:"x 1s",animationName:V.a.keyframes(X.bounceIn,"bounceIn"),animationDuration:"10s"}},U=(c.a.Component,function(e){var t=e.user,n=e.onCheckIn,c=e.changeStatus,o=e.changeIdCheck,i=Object(r.useState)(""),u=Object(m.a)(i,2),s=u[0],h=u[1],d=Object(l.g)();Object(r.useEffect)((function(){b()}),[c]);var b=function(){var e=Object(j.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J({empCode:JSON.parse(localStorage.getItem("user")).code});case 2:(t=e.sent).data&&0==t.data.errorCode?1==t.data.data.notCheckInYet?h(0):1==t.data.data.notCheckOutYet?(h(1),o(t.data.data.checkInID)):1==t.data.data.doneCheck&&h(2):403==t.status||401==t.status?(localStorage.removeItem("TOKEN_KEY"),localStorage.removeItem("user"),setTimeout((function(){d.push("/")}),100)):window.alert("L\u1ed7i");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(a.jsxs)(S.a,{fixed:!0,style:{height:"100vh",position:"relative"},children:[Object(a.jsx)("div",{style:{marginTop:10}}),Object(a.jsx)("br",{}),Object(a.jsx)("div",{style:{textAlign:"right"},children:Object(a.jsx)(f.a,{variant:"contained",color:"secondary",onClick:function(){localStorage.removeItem("TOKEN_KEY"),localStorage.removeItem("user"),setTimeout((function(){d.push("/")}),100)},children:"\u0110\u0103ng xu\u1ea5t"})}),Object(a.jsxs)("div",{style:{textAlign:"center",fontSize:"35px",marginTop:"15px"},children:[Object(a.jsx)(g.a,{variant:"h4",style:{color:" #3399ff"},children:"Ch\xe0o m\u1eebng"}),Object(a.jsx)("h6",{style:{fontSize:"30px",margin:"0px",color:" #3399ff"},children:t?t.name:""})]}),Object(a.jsx)("br",{}),Object(a.jsx)(y.a,{container:!0,style:{height:"65%",justifyContent:"center"},children:Object(a.jsx)(L.a,{"aria-label":"edit",style:{width:"30vw",height:"30vw"},onClick:function(){n(s)},className:0==s?"checkin":1==s?"checkout":"complete",children:Object(a.jsx)("span",{style:{fontSize:"3vw"},children:0==s?"CHECK-IN":1==s?"CHECK-OUT":"Ho\xe0n th\xe0nh"})})})]})}),R=function(e){Object(l.h)();var t=Object(r.useState)({latitude:null,longitude:null}),n=Object(m.a)(t,2),c=(n[0],n[1]),o=Object(r.useState)(""),i=Object(m.a)(o,2),u=i[0],s=i[1],h=Object(r.useState)(""),d=Object(m.a)(h,2),f=d[0],b=d[1],O=Object(r.useState)({}),g=Object(m.a)(O,2),v=g[0],x=g[1],y=Object(l.g)();Object(r.useEffect)((function(){var e=JSON.parse(localStorage.getItem("user"));x(e),k()}),[]);var k=function(){navigator.geolocation.getCurrentPosition((function(e){e.coords.longitude&&c({latitude:e.coords.latitude,longitude:e.coords.longitude})}))},C=function(){var e=Object(j.a)(p.a.mark((function e(t){var n,a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!=t){e.next=7;break}return e.next=3,D({employeeCode:v.code,companyCode:"DCV",checkinId:null,lat:"20.99847600",lng:"105.80720300",deviceName:"Xiaomi",deviceMac:"Xiaomi Mac"});case 3:(n=e.sent).data&&200==n.data.errorCode?(alert("Checkin th\xe0nh c\xf4ng"),s(5)):403==n.status||401==n.status?(localStorage.removeItem("TOKEN_KEY"),localStorage.removeItem("user"),setTimeout((function(){y.push("/")}),100)):alert("L\u1ed7i th\xf4ng tin"),e.next=12;break;case 7:if(1!=t){e.next=12;break}return e.next=10,A({employeeCode:v.code,companyCode:"DCV",checkinId:f,lat:"20.99847600",lng:"105.80720300",deviceName:"Xiaomi",deviceMac:"Xiaomi Mac"});case 10:(a=e.sent).data&&200==a.data.errorCode?(alert("Checkout th\xe0nh c\xf4ng"),s(6)):403==a.status||401==a.status?(localStorage.removeItem("TOKEN_KEY"),localStorage.removeItem("user"),setTimeout((function(){y.push("/")}),100)):alert("L\u1ed7i th\xf4ng tin");case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(a.jsx)(U,{user:v,onCheckIn:C,changeStatus:u,changeIdCheck:function(e){b(e)}})},Z=function(){Object(l.g)();function e(e){var t=e.children,n=Object(s.a)(e,["children"]),r=localStorage.getItem("TOKEN_KEY");return Object(a.jsx)(l.b,Object(u.a)(Object(u.a)({},n),{},{render:function(e){var n=e.location;return r?t:Object(a.jsx)(l.a,{to:{pathname:"/",state:{from:n}}})}}))}function t(e){var t=e.children,n=Object(s.a)(e,["children"]),r=localStorage.getItem("TOKEN_KEY");return Object(a.jsx)(l.b,Object(u.a)(Object(u.a)({},n),{},{render:function(e){var n=e.location;return r?Object(a.jsx)(l.a,{to:{pathname:"/home",state:{from:n}}}):t}}))}return Object(a.jsx)(h.a,{children:Object(a.jsxs)(l.d,{children:[Object(a.jsx)(t,{exact:!0,path:"/",children:Object(a.jsx)(F,{})}),Object(a.jsx)(e,{path:"/home",children:Object(a.jsx)(R,{})})]})})};var $=function(){return Object(a.jsx)(Z,{})},ee=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,298)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,c=t.getLCP,o=t.getTTFB;n(e),a(e),r(e),c(e),o(e)}))};i.a.render(Object(a.jsx)(c.a.StrictMode,{children:Object(a.jsx)($,{})}),document.getElementById("root")),ee()}},[[250,1,2]]]);
//# sourceMappingURL=main.d29c9c84.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["api/api.js","api/user.js","View/Login/LoginScreen.js","View/Home/ButtonCheckIn.js","View/Home/HomeView.js","View/Home/HomeContainer.js","View/RootView.js","App.js","reportWebVitals.js","index.js"],"names":["GetData","url","data","a","token","localStorage","getItem","myRequest","method","headers","Accept","Authorization","params","timeout","console","log","axios","then","response","catch","error","request","message","status","PostLogin","json","JSON","stringify","PostData","defaults","loginApi","body","res","err","checkInApi","checkOutApi","statusCheckIn","Copyright","Typography","variant","color","align","Link","href","Date","getFullYear","useStyles","makeStyles","theme","paper","display","flexDirection","alignItems","avatar","margin","spacing","backgroundColor","palette","secondary","main","form","width","submit","LoginScreen","classes","history","useHistory","useState","appcode","username","password","state","setState","helperText","sethelperText","onLogin","errorCode","setItem","accessToken","name","fullName","code","push","pathname","style","height","Container","component","maxWidth","CssBaseline","className","marginTop","marginBottom","src","TextField","required","fullWidth","label","autoComplete","onChange","e","target","value","autoFocus","type","FormHelperText","marginLeft","fontSize","Button","onClick","Grid","container","item","xs","Box","mt","styles","bounce","animation","animationName","Radium","keyframes","bounceIn","animationDuration","HomeView","React","Component","props","user","onCheckIn","changeStatus","changeIdCheck","setStatus","useEffect","getInfo","empCode","parse","notCheckInYet","notCheckOutYet","checkInID","doneCheck","removeItem","setTimeout","window","alert","fixed","position","textAlign","justifyContent","Fab","aria-label","HomeContainer","useLocation","latitude","longitude","setChangeStatus","changeId","setChangeId","setUser","infoUser","getPosition","navigator","geolocation","getCurrentPosition","coords","employeeCode","companyCode","checkinId","lat","lng","deviceName","deviceMac","id","RootView","PrivateRoute","children","rest","render","location","to","from","PublicRoute","exact","path","App","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","StrictMode","document","getElementById"],"mappings":"gYAGO,SAAeA,EAAtB,oC,4CAAO,WAAuBC,EAAKC,GAA5B,iBAAAC,EAAA,6DACCC,EAAQC,aAAaC,QAAQ,aAC/BC,EAAY,CACdC,OAAQ,MACRP,MACAQ,QAAS,CACPC,OAAQ,mBACR,eAAgB,mBAChBC,cAAe,UAAYP,GAE7BQ,OAAO,eACFV,GAELW,QAAS,KAGXC,QAAQC,IAAI,aAAcR,GAhBrB,SAiBQS,IAAMT,GAChBU,MAAK,SAACC,GAAD,OAAcA,KACnBD,MAAK,SAACC,GAAD,OAAcA,KACnBC,OAAM,SAACC,GAMN,OALAN,QAAQC,IAAIK,EAAMC,SACN,CACVC,QAAS,QACTC,OAAQH,EAAMC,QAAQE,WAxBvB,oF,sBA6BA,SAAeC,EAAtB,oC,4CAAO,WAAyBvB,EAAKwB,GAA9B,2BAAAtB,EAAA,+FACDI,EAAY,CACdC,OAAQ,OACRP,MACAQ,QAAS,CACPC,OAAQ,mBACR,eAAgB,oBAElBG,QAAS,IACTX,KAAMwB,KAAKC,UAAUF,IAEvBX,QAAQC,IAAI,mBAAoBR,GAX3B,SAYQS,IAAMT,GAChBU,MAAK,SAACC,GAAD,OAAcA,KACnBD,MAAK,SAACC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,SAAH,OACLpG,EAGC,cAAC,IAAD,CACEqG,GAAI,CACFhG,SAAU,QACVZ,MAAO,CAAE6G,KAAMF,MALnBH,MAaV,OACE,cAAC,IAAD,UACE,eAAC,IAAD,WACE,cAACM,EAAD,CAAaC,OAAK,EAACC,KAAK,IAAxB,SACE,cAAC,EAAD,MAEF,cAACT,EAAD,CAAcS,KAAK,QAAnB,SACE,cAAC,EAAD,YClDKC,MAJf,WACE,OAAO,cAAC,EAAD,KCQMC,GAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,8BAAqB1K,MAAK,YAAkD,IAA/C2K,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAAShB,OACP,cAAC,IAAMiB,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1BX,O","file":"static/js/main.d29c9c84.chunk.js","sourcesContent":["import axios from \"axios\";\r\naxios.defaults.timeout = 10000;\r\n\r\nexport async function GetData(url, data) {\r\n const token = localStorage.getItem(\"TOKEN_KEY\");\r\n let myRequest = {\r\n method: \"get\",\r\n url,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n Authorization: \"Bearer \" + token,\r\n },\r\n params: {\r\n ...data,\r\n },\r\n timeout: 60 * 1000,\r\n // withCredentials: true,\r\n };\r\n console.log(\"My request\", myRequest);\r\n return await axios(myRequest)\r\n .then((response) => response)\r\n .then((response) => response)\r\n .catch((error) => {\r\n console.log(error.request);\r\n const err = {\r\n message: \"error\",\r\n status: error.request.status,\r\n };\r\n return err;\r\n });\r\n}\r\nexport async function PostLogin(url, json, isAuth = true) {\r\n let myRequest = {\r\n method: \"post\",\r\n url,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n },\r\n timeout: 60 * 1000,\r\n data: JSON.stringify(json),\r\n };\r\n console.log(\"post data mobile\", myRequest);\r\n return await axios(myRequest)\r\n .then((response) => response)\r\n .then((response) => response)\r\n .catch((error) => {\r\n console.log(error.request);\r\n const err = {\r\n message: \"error\",\r\n status: error.request.status,\r\n };\r\n return err;\r\n });\r\n}\r\n\r\nexport async function PostData(url, json, isAuth = true) {\r\n const token = localStorage.getItem(\"TOKEN_KEY\");\r\n let myRequest = {\r\n method: \"post\",\r\n url,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n Authorization: \"Bearer \" + token,\r\n },\r\n timeout: 60 * 1000,\r\n data: JSON.stringify(json),\r\n };\r\n console.log(\"post data mobile\", myRequest);\r\n return await axios(myRequest)\r\n .then((response) => response)\r\n .then((response) => response)\r\n .catch((error) => {\r\n console.log(error.request);\r\n const err = {\r\n message: \"error\",\r\n status: error.request.status,\r\n };\r\n return err;\r\n });\r\n}\r\n","import { GetData, PostLogin, PostData } from \"./api\";\r\n\r\nexport const loginApi = async (body) =>\r\n PostLogin(\"http://hrm.auth.dcv.vn/api/v1/auth/login\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n\r\nexport const getDataApi = async (body) =>\r\n GetData(\"http://hrm.auth.dcv.vn/api/v1/auth/login\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n\r\nexport const checkInApi = async (body) =>\r\n PostData(\"http://hrm.japi.dcv.vn/venus-service/checkinService/checkin\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n\r\nexport const checkOutApi = async (body) =>\r\n PostData(\"http://hrm.japi.dcv.vn/venus-service/checkinService/checkout\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n\r\nexport const statusCheckIn = async (body) =>\r\n GetData(\"http://hrm.api.dcv.vn/api/v1/checkin/personaldailycheckin\", body)\r\n .then((res) => res)\r\n .catch((err) => err);\r\n","import React, { useState } from \"react\";\r\nimport Avatar from \"@material-ui/core/Avatar\";\r\nimport Button from \"@material-ui/core/Button\";\r\nimport CssBaseline from \"@material-ui/core/CssBaseline\";\r\nimport TextField from \"@material-ui/core/TextField\";\r\nimport { FormHelperText, Link, Grid, Box, Typography } from \"@material-ui/core\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport LockOutlinedIcon from \"@material-ui/icons/LockOutlined\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport Container from \"@material-ui/core/Container\";\r\nimport { loginApi } from \"../../api/user\";\r\n\r\nfunction Copyright() {\r\n return (\r\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\r\n {\"Copyright © \"}\r\n <Link color=\"inherit\" href=\"https://material-ui.com/\">\r\n Your Website\r\n </Link>{\" \"}\r\n {new Date().getFullYear()}\r\n {\".\"}\r\n </Typography>\r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n paper: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n alignItems: \"center\",\r\n },\r\n avatar: {\r\n margin: theme.spacing(1),\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n form: {\r\n width: \"100%\", // Fix IE 11 issue.\r\n },\r\n submit: {\r\n margin: theme.spacing(3, 0, 2),\r\n },\r\n}));\r\n\r\nconst LoginScreen = () => {\r\n const classes = useStyles();\r\n let history = useHistory();\r\n const [state, setState] = useState({\r\n appcode: \"Dcv\",\r\n username: \"\",\r\n password: \"\",\r\n });\r\n\r\n const [helperText, sethelperText] = useState(\"\");\r\n const onLogin = async () => {\r\n if (state.username === \"\" || state.password === \"\") {\r\n sethelperText(\"\");\r\n sethelperText(\"Cần phải điền đầy đủ email và password\");\r\n } else {\r\n sethelperText(\"\");\r\n const res = await loginApi(state);\r\n\r\n if (res.data && res.data.errorCode === 0) {\r\n localStorage.setItem(\"TOKEN_KEY\", res.data.data.accessToken);\r\n localStorage.setItem(\r\n \"user\",\r\n JSON.stringify({\r\n name: res.data.data.fullName,\r\n code: res.data.data.code,\r\n })\r\n );\r\n history.push({\r\n pathname: \"/home\",\r\n state: { code: res.data.data.code, fullName: res.data.data.fullName },\r\n });\r\n } else if (res.data && res.data.errorCode === 1) {\r\n sethelperText(\"\");\r\n sethelperText(\"Sai email hoặc mật khẩu\");\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <div style={{ height: \"100vh\" }}>\r\n <Container component=\"main\" maxWidth=\"xs\">\r\n <CssBaseline />\r\n <div className={classes.paper}>\r\n <img\r\n style={{ width: 200, height: 100, marginTop: 10, marginBottom: 10 }}\r\n src=\"/logo-DCV.png\"\r\n />\r\n <Typography color={\"primary\"} component=\"h1\" variant=\"h5\">\r\n ĐĂNG NHẬP\r\n </Typography>\r\n <TextField\r\n variant=\"outlined\"\r\n margin=\"normal\"\r\n required\r\n fullWidth\r\n label=\"Email\"\r\n autoComplete=\"email\"\r\n onChange={(e) => {\r\n setState({\r\n ...state,\r\n username: e.target.value,\r\n });\r\n }}\r\n autoFocus\r\n />\r\n <TextField\r\n variant=\"outlined\"\r\n margin=\"normal\"\r\n required\r\n fullWidth\r\n label=\"Mật khẩu\"\r\n type=\"password\"\r\n onChange={(e) => {\r\n setState({\r\n ...state,\r\n password: e.target.value,\r\n });\r\n }}\r\n autoComplete=\"current-password\"\r\n />\r\n <div style={{ width: \"100%\" }}>\r\n <FormHelperText\r\n style={{ marginLeft: \"16px\", color: \"red\", fontSize: \"13px\" }}\r\n >\r\n {helperText}\r\n </FormHelperText>\r\n </div>\r\n\r\n <Button\r\n type=\"submit\"\r\n fullWidth\r\n variant=\"contained\"\r\n color=\"primary\"\r\n className={classes.submit}\r\n onClick={onLogin}\r\n >\r\n Đăng nhập\r\n </Button>\r\n <Grid container>\r\n <Grid item xs>\r\n <Link href=\"#\" variant=\"body2\">\r\n Quên mật khẩu?\r\n </Link>\r\n </Grid>\r\n </Grid>\r\n </div>\r\n <Box mt={8}>\r\n <Copyright />\r\n </Box>\r\n </Container>\r\n </div>\r\n );\r\n};\r\n\r\nexport default LoginScreen;\r\n","import React from \"react\";\r\nimport { bounce, fadeIn, bounceIn } from \"react-animations\";\r\nimport Radium, { StyleRoot } from \"radium\";\r\n\r\nconst styles = {\r\n bounce: {\r\n animation: \"x 1s\",\r\n animationName: Radium.keyframes(bounceIn, \"bounceIn\"),\r\n animationDuration: \"10s\",\r\n },\r\n};\r\n\r\nclass ButtonCheckIn extends React.Component {\r\n render() {\r\n return (\r\n <StyleRoot>\r\n <div className=\"test\" style={styles.bounce}>\r\n aaa\r\n </div>\r\n </StyleRoot>\r\n );\r\n }\r\n}\r\n\r\nexport default ButtonCheckIn;\r\n","import React, { useState, useEffect } from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n Container,\r\n Grid,\r\n Paper,\r\n Card,\r\n Typography,\r\n Fab,\r\n Button,\r\n} from \"@material-ui/core\";\r\nimport { statusCheckIn } from \"../../api/user\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport Alert from \"@material-ui/lab/Alert\";\r\nimport \"./HomeView.css\";\r\n\r\nimport ButtonCheckIn from \"./ButtonCheckIn\";\r\n\r\nconst HomeView = (props) => {\r\n const { user, onCheckIn, changeStatus, changeIdCheck } = props;\r\n\r\n const [status, setStatus] = useState(\"\");\r\n let history = useHistory();\r\n\r\n useEffect(() => {\r\n getInfo();\r\n }, [changeStatus]);\r\n\r\n const getInfo = async () => {\r\n const res = await statusCheckIn({\r\n empCode: JSON.parse(localStorage.getItem(\"user\")).code,\r\n });\r\n if (res.data && res.data.errorCode == 0) {\r\n if (res.data.data.notCheckInYet == 1) {\r\n setStatus(0);\r\n } else if (res.data.data.notCheckOutYet == 1) {\r\n setStatus(1);\r\n changeIdCheck(res.data.data.checkInID);\r\n } else if (res.data.data.doneCheck == 1) {\r\n setStatus(2);\r\n }\r\n } else if (res.status == 403 || res.status == 401) {\r\n localStorage.removeItem(\"TOKEN_KEY\");\r\n localStorage.removeItem(\"user\");\r\n setTimeout(() => {\r\n history.push(\"/\");\r\n }, 100);\r\n } else {\r\n window.alert(\"Lỗi\");\r\n }\r\n };\r\n\r\n const signOut = () => {\r\n localStorage.removeItem(\"TOKEN_KEY\");\r\n localStorage.removeItem(\"user\");\r\n setTimeout(() => {\r\n history.push(\"/\");\r\n }, 100);\r\n };\r\n return (\r\n <Container fixed style={{ height: \"100vh\", position: \"relative\" }}>\r\n <div style={{ marginTop: 10 }} />\r\n <br />\r\n <div style={{ textAlign: \"right\" }}>\r\n <Button variant=\"contained\" color=\"secondary\" onClick={signOut}>\r\n Đăng xuất\r\n </Button>\r\n </div>\r\n <div style={{ textAlign: \"center\", fontSize: \"35px\", marginTop: \"15px\" }}>\r\n <Typography variant={\"h4\"} style={{ color: \" #3399ff\" }}>\r\n Chào mừng\r\n </Typography>\r\n <h6 style={{ fontSize: \"30px\", margin: \"0px\", color: \" #3399ff\" }}>\r\n {user ? user.name : \"\"}\r\n </h6>\r\n </div>\r\n <br />\r\n <Grid container style={{ height: \"65%\", justifyContent: \"center\" }}>\r\n <Fab\r\n aria-label=\"edit\"\r\n style={{ width: \"30vw\", height: \"30vw\" }}\r\n onClick={() => {\r\n onCheckIn(status);\r\n }}\r\n className={\r\n status == 0 ? \"checkin\" : status == 1 ? \"checkout\" : \"complete\"\r\n }\r\n >\r\n <span style={{ fontSize: \"3vw\" }}>\r\n {status == 0\r\n ? \"CHECK-IN\"\r\n : status == 1\r\n ? \"CHECK-OUT\"\r\n : \"Hoàn thành\"}\r\n </span>\r\n </Fab>\r\n </Grid>\r\n </Container>\r\n );\r\n};\r\n\r\nexport default HomeView;\r\n","import React, { useState, useEffect } from \"react\";\r\nimport HomeView from \"./HomeView\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { checkInApi, checkOutApi } from \"../../api/user\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport Alert from \"@material-ui/lab/Alert\";\r\n\r\nconst HomeContainer = (props) => {\r\n const location = useLocation();\r\n\r\n const [state, setState] = useState({\r\n latitude: null,\r\n longitude: null,\r\n });\r\n const [changeStatus, setChangeStatus] = useState(\"\");\r\n const [changeId, setChangeId] = useState(\"\");\r\n\r\n const [user, setUser] = useState({});\r\n let history = useHistory();\r\n\r\n const changeIdCheck = (id) => {\r\n setChangeId(id);\r\n };\r\n\r\n useEffect(() => {\r\n const infoUser = JSON.parse(localStorage.getItem(\"user\"));\r\n setUser(infoUser);\r\n getPosition();\r\n }, []);\r\n\r\n const getPosition = () => {\r\n navigator.geolocation.getCurrentPosition((position) => {\r\n if (position.coords.longitude)\r\n setState({\r\n latitude: position.coords.latitude,\r\n longitude: position.coords.longitude,\r\n });\r\n });\r\n };\r\n\r\n const onCheckIn = async (status) => {\r\n if (status == 0) {\r\n let res = await checkInApi({\r\n employeeCode: user.code,\r\n companyCode: \"DCV\",\r\n checkinId: null,\r\n lat: \"20.99847600\",\r\n lng: \"105.80720300\",\r\n deviceName: \"Xiaomi\",\r\n deviceMac: \"Xiaomi Mac\",\r\n });\r\n if (res.data && res.data.errorCode == 200) {\r\n alert(\"Checkin thành công\");\r\n setChangeStatus(5);\r\n } else if (res.status == 403 || res.status == 401) {\r\n localStorage.removeItem(\"TOKEN_KEY\");\r\n localStorage.removeItem(\"user\");\r\n setTimeout(() => {\r\n history.push(\"/\");\r\n }, 100);\r\n } else {\r\n alert(\"Lỗi thông tin\");\r\n }\r\n } else if (status == 1) {\r\n let res = await checkOutApi({\r\n employeeCode: user.code,\r\n companyCode: \"DCV\",\r\n checkinId: changeId,\r\n lat: \"20.99847600\",\r\n lng: \"105.80720300\",\r\n deviceName: \"Xiaomi\",\r\n deviceMac: \"Xiaomi Mac\",\r\n });\r\n if (res.data && res.data.errorCode == 200) {\r\n alert(\"Checkout thành công\");\r\n setChangeStatus(6);\r\n } else if (res.status == 403 || res.status == 401) {\r\n localStorage.removeItem(\"TOKEN_KEY\");\r\n localStorage.removeItem(\"user\");\r\n setTimeout(() => {\r\n history.push(\"/\");\r\n }, 100);\r\n } else {\r\n alert(\"Lỗi thông tin\");\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <HomeView\r\n user={user}\r\n onCheckIn={onCheckIn}\r\n changeStatus={changeStatus}\r\n changeIdCheck={changeIdCheck}\r\n />\r\n );\r\n};\r\n\r\nexport default HomeContainer;\r\n","import { BrowserRouter, Switch, Route, Link } from \"react-router-dom\";\r\nimport { useHistory, Redirect } from \"react-router-dom\";\r\nimport React, { useEffect, useState } from \"react\";\r\nimport LoginScreen from \"./Login/LoginScreen\";\r\nimport HomeScreen from \"./Home/HomeContainer\";\r\n\r\nconst RootView = () => {\r\n let history = useHistory();\r\n\r\n function PrivateRoute({ children, ...rest }) {\r\n let accessToken = localStorage.getItem(\"TOKEN_KEY\");\r\n return (\r\n <Route\r\n {...rest}\r\n render={({ location }) =>\r\n accessToken ? (\r\n children\r\n ) : (\r\n <Redirect\r\n to={{\r\n pathname: \"/\",\r\n state: { from: location },\r\n }}\r\n />\r\n )\r\n }\r\n />\r\n );\r\n }\r\n\r\n function PublicRoute({ children, ...rest }) {\r\n let accessToken = localStorage.getItem(\"TOKEN_KEY\");\r\n return (\r\n <Route\r\n {...rest}\r\n render={({ location }) =>\r\n !accessToken ? (\r\n children\r\n ) : (\r\n <Redirect\r\n to={{\r\n pathname: \"/home\",\r\n state: { from: location },\r\n }}\r\n />\r\n )\r\n }\r\n />\r\n );\r\n }\r\n return (\r\n <BrowserRouter>\r\n <Switch>\r\n <PublicRoute exact path=\"/\">\r\n <LoginScreen />\r\n </PublicRoute>\r\n <PrivateRoute path=\"/home\">\r\n <HomeScreen />\r\n </PrivateRoute>\r\n </Switch>\r\n </BrowserRouter>\r\n );\r\n};\r\n\r\nexport default RootView;\r\n","import RootView from \"./View/RootView\";\r\nimport HomeContainer from \"./View/Home/HomeContainer\";\r\n\r\nfunction App() {\r\n return <RootView />;\r\n}\r\n\r\nexport default App;\r\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment