import { fetchCustomBackendError } from '@/service/api'; const Request = () => { const { t } = useTranslation(); async function logout() { await fetchCustomBackendError('8888', t('request.logoutMsg')); } async function logoutWithModal() { await fetchCustomBackendError('7777', t('request.logoutWithModalMsg')); } async function refreshToken() { await fetchCustomBackendError('9999', t('request.tokenExpired')); } async function handleRepeatedMessageError() { await Promise.all([ fetchCustomBackendError('2222', t('page.function.request.repeatedErrorMsg1')), fetchCustomBackendError('2222', t('page.function.request.repeatedErrorMsg1')), fetchCustomBackendError('2222', t('page.function.request.repeatedErrorMsg1')), fetchCustomBackendError('3333', t('page.function.request.repeatedErrorMsg2')), fetchCustomBackendError('3333', t('page.function.request.repeatedErrorMsg2')), fetchCustomBackendError('3333', t('page.function.request.repeatedErrorMsg2')) ]); } async function handleRepeatedModalError() { await Promise.all([ fetchCustomBackendError('7777', t('request.logoutWithModalMsg')), fetchCustomBackendError('7777', t('request.logoutWithModalMsg')), fetchCustomBackendError('7777', t('request.logoutWithModalMsg')) ]); } return ( {t('common.trigger')} {t('common.trigger')} {t('common.trigger')} {t('page.function.request.repeatedError')} (Message) {t('page.function.request.repeatedError')}(Modal) ); }; export default Request;