|
|
|
@ -7,6 +7,8 @@ import zhLocale from 'antd/locale/zh_CN'
|
|
|
|
|
import 'dayjs/locale/zh-cn'
|
|
|
|
|
import { useEffect } from 'react'
|
|
|
|
|
import { Outlet, useHref, useNavigate } from 'react-router-dom'
|
|
|
|
|
import { appendRequestHeader } from '@/utils/request'
|
|
|
|
|
import { loadPageSpy } from '@/utils/pagespy'
|
|
|
|
|
|
|
|
|
|
import AppLogo from '@/assets/highlights_travel_300_300.png'
|
|
|
|
|
import '@/assets/App.css'
|
|
|
|
@ -33,8 +35,10 @@ function AuthApp() {
|
|
|
|
|
Notification.requestPermission();
|
|
|
|
|
}
|
|
|
|
|
if (loginUser.userId > 0) {
|
|
|
|
|
appendRequestHeader('X-User-Id', loginUser.userId);
|
|
|
|
|
loadPageSpy(loginUser.username);
|
|
|
|
|
connectWebsocket(loginUser.userId);
|
|
|
|
|
fetchInitialData(loginUser.userId); // userIdStr
|
|
|
|
|
fetchInitialData(loginUser.userId);
|
|
|
|
|
}
|
|
|
|
|
return () => {
|
|
|
|
|
disconnectWebsocket();
|
|
|
|
|