You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 'lng' how to get it
// Do not use cookies
http.js
const isServer = typeof window === 'undefined';
const http = axios.create({
baseURL: process.env.REACT_APP_API_PATH,
timeout: 60000,
});
http.interceptors.response.use( async (response) => {
if (error.response?.status === 4005) {
if(isServer){
const { useTranslation } = (await import('@/app/i18n/index'));
// 'lng' how to get it
const { t } = useTranslation(lng, 'h-page');
message.error(t('K9')); // please login again
}else{
const { useTranslation } = (await import('@/app/i18n/client'));
// 'lng' how to get it
const { t } = useTranslation(lng, 'h-page');
message.error(t('K9')); // please login again
}
}
})
order.tsx
import http from '@/app/http';
import React from 'react'
export default function Order() {
http.get('/api/order/list').then(res => {})
return (
)
}
The text was updated successfully, but these errors were encountered:
// 'lng' how to get it
// Do not use cookies
http.js
const isServer = typeof window === 'undefined';
const http = axios.create({
baseURL: process.env.REACT_APP_API_PATH,
timeout: 60000,
});
http.interceptors.response.use( async (response) => {
if (error.response?.status === 4005) {
if(isServer){
const { useTranslation } = (await import('@/app/i18n/index'));
// 'lng' how to get it
const { t } = useTranslation(lng, 'h-page');
message.error(t('K9')); // please login again
}else{
const { useTranslation } = (await import('@/app/i18n/client'));
// 'lng' how to get it
const { t } = useTranslation(lng, 'h-page');
message.error(t('K9')); // please login again
}
}
})
order.tsx
import http from '@/app/http';
import React from 'react'
export default function Order() {
http.get('/api/order/list').then(res => {})
return (
)
}
The text was updated successfully, but these errors were encountered: