import clsx from 'clsx';
import LogoBannerH from '@/assets/logo-baner-h.png';
import { Beian } from '@/modules/beian/beian';
import { useUserStore } from '../store';
import { useShallow } from 'zustand/shallow';
import { useEffect } from 'react';
type Props = {
children?: React.ReactNode;
className?: string;
};
export const Layout = (props: Props) => {
return (
);
};
export const MainLayout = (props: Props) => {
const config = useUserStore((state) => state.config);
return (
{props.children}
登录即表示同意 服务条款 和 隐私政策
);
};
export const LoginWrapper = (props: Props) => {
const config = useUserStore((state) => state.config);
const loginWay = config?.loginWay || ['account'];
const store = useUserStore(
useShallow((state) => {
return {
loginByWechat: state.loginByWechat,
};
}),
);
const checkWechat = () => {
const url = new URL(window.location.href);
const code = url.searchParams.get('code');
const state = url.searchParams.get('state');
if (code && state) {
store.loginByWechat(code);
}
};
useEffect(() => {
checkWechat();
}, []);
return (
欢迎回来
{loginWay.length > 1 && 请选择登陆方式
}
{props.children}
);
};