diff --git a/src/pages/IndexPage/Index.tsx b/src/pages/IndexPage/Index.tsx index 68cdad0..01613a8 100644 --- a/src/pages/IndexPage/Index.tsx +++ b/src/pages/IndexPage/Index.tsx @@ -12,6 +12,7 @@ import './Index.sass' let assessorsNameList: string[] let registeredNameList: string[] let headName: string +let headId: string export default () => { const getAssessors = async () => { @@ -28,11 +29,17 @@ export default () => { } const getHead = async () => { - const head = await getApi('get-headname') - headName = head + const response = await getApi('get-headname') + headName = response sessionStorage.setItem('head', headName) } + const getHeadId = async () => { + const response = await getApi('get-headid') + headId = response + sessionStorage.setItem('headid', headId) + } + const clearCache = async () => { caches.keys() } @@ -42,6 +49,7 @@ export default () => { await getAssessors() await getRegistered() await getHead() + await getHeadId() }) return ( diff --git a/src/pages/MainPage/Main.tsx b/src/pages/MainPage/Main.tsx index 3a88be0..71bc716 100644 --- a/src/pages/MainPage/Main.tsx +++ b/src/pages/MainPage/Main.tsx @@ -13,8 +13,7 @@ import { Show } from 'solid-js/web' import './Main.sass' const PESO = import.meta.env.VITE_PESO -const ID = import.meta.env.VITE_HEADID -// const NAME = import.meta.env.VITE_HEAD +const ID = sessionStorage.get('headid') const PUBLICIP = import.meta.env.VITE_PUBLICIP export default () => { diff --git a/src/pages/RegisterPage/Register.tsx b/src/pages/RegisterPage/Register.tsx index 5aff5ae..2624ffc 100644 --- a/src/pages/RegisterPage/Register.tsx +++ b/src/pages/RegisterPage/Register.tsx @@ -10,7 +10,7 @@ import { checkConnection, getApi, postApi } from '../../utils/functions' import './Register.sass' export default () => { - const APPROVERNAME = import.meta.env.VITE_HEAD + const APPROVERNAME = sessionStorage.getItem('head') const assessors = JSON.parse(sessionStorage.getItem('assessors')!) const roles = ['ASSESSOR', 'APPROVER']