|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
|
|
import { createStyles, useTheme } from 'antd-style';
|
|
|
|
|
import dynamic from 'next/dynamic';
|
|
|
|
|
import { PropsWithChildren, memo } from 'react';
|
|
|
|
|
import { PropsWithChildren, memo, useEffect, useRef } from 'react';
|
|
|
|
|
import { Flexbox } from 'react-layout-kit';
|
|
|
|
|
|
|
|
|
|
import { BANNER_HEIGHT } from '@/features/AlertBanner/CloudBanner';
|
|
|
|
@ -12,7 +12,7 @@ import { Divider } from "antd";
|
|
|
|
|
import Avatar from './SideBar/Avatar';
|
|
|
|
|
|
|
|
|
|
import SideBar from './SideBar';
|
|
|
|
|
|
|
|
|
|
import { useUserStore } from '@/store/user';
|
|
|
|
|
|
|
|
|
|
const title:{[key: string]: string } = {
|
|
|
|
|
"/chat": '会话',
|
|
|
|
@ -70,6 +70,13 @@ const useStyles = createStyles(({ css }) => ({
|
|
|
|
|
`,
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
const getCookie=(name)=> {
|
|
|
|
|
let matches = document.cookie.match(new RegExp(
|
|
|
|
|
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
|
|
|
|
));
|
|
|
|
|
return matches ? decodeURIComponent(matches[1]) : undefined;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const CloudBanner = dynamic(() => import('@/features/AlertBanner/CloudBanner'));
|
|
|
|
|
|
|
|
|
|
const Layout = memo<PropsWithChildren>(({ children }) => {
|
|
|
|
@ -77,8 +84,15 @@ const Layout = memo<PropsWithChildren>(({ children }) => {
|
|
|
|
|
const theme = useTheme();
|
|
|
|
|
const { styles, cx } = useStyles()
|
|
|
|
|
const { showCloudPromotion } = useServerConfigStore(featureFlagsSelectors);
|
|
|
|
|
const pathName = window?.location?.pathname ?? '/welcome'
|
|
|
|
|
// const pathName = window?.location?.pathname ?? '/welcome'
|
|
|
|
|
// const pathName = '/welcome'
|
|
|
|
|
const [openSignIn] = useUserStore((s) => [s.openLogin]);
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const cookieValue = getCookie('organizationLogo');
|
|
|
|
|
if(!cookieValue) {
|
|
|
|
|
openSignIn();
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|