|
|
|
@ -2,10 +2,10 @@ import ErrorBoundary from '@/components/ErrorBoundary'
|
|
|
|
|
import useAuthStore from '@/stores/AuthStore'
|
|
|
|
|
import useConversationStore from '@/stores/ConversationStore'
|
|
|
|
|
import { useThemeContext } from '@/stores/ThemeContext'
|
|
|
|
|
import { App as AntApp, ConfigProvider, Empty, Layout, Typography, theme } from 'antd'
|
|
|
|
|
import { App as AntApp, ConfigProvider, Empty, theme } from 'antd'
|
|
|
|
|
import zhLocale from 'antd/locale/zh_CN'
|
|
|
|
|
import 'dayjs/locale/zh-cn'
|
|
|
|
|
import { useEffect, useState } from 'react'
|
|
|
|
|
import { useEffect } from 'react'
|
|
|
|
|
import { Outlet, useHref, useNavigate } from 'react-router-dom'
|
|
|
|
|
|
|
|
|
|
import AppLogo from '@/assets/highlights_travel_300_300.png'
|
|
|
|
@ -41,17 +41,15 @@ function AuthApp() {
|
|
|
|
|
};
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
// 除了路由 /p...以外都需要登陆系统
|
|
|
|
|
const needToLogin = (loginUser.userId === -1) && (href.indexOf('/p/') === -1)
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// 除了路由 /p...以外都需要登陆系统
|
|
|
|
|
if ((loginUser.userId === -1) && (href.indexOf('/p/') === -1)) {
|
|
|
|
|
if (needToLogin) {
|
|
|
|
|
navigate('/p/dingding/login?origin_url=' + href)
|
|
|
|
|
}
|
|
|
|
|
}, [href])
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
token: { colorBgContainer },
|
|
|
|
|
} = theme.useToken()
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<ConfigProvider
|
|
|
|
|
theme={{
|
|
|
|
@ -67,7 +65,7 @@ function AuthApp() {
|
|
|
|
|
renderEmpty={() => <Empty description={false} />}>
|
|
|
|
|
<AntApp>
|
|
|
|
|
<ErrorBoundary>
|
|
|
|
|
<Outlet />
|
|
|
|
|
{needToLogin ? <>login...</> : <Outlet />}
|
|
|
|
|
<dialog id='about-dialog' className='border-0'>
|
|
|
|
|
<img className='logo' src={AppLogo} alt='logo' />
|
|
|
|
|
<section className='about'>
|
|
|
|
|