fix: phone

This commit is contained in:
archer
2023-07-17 20:52:11 +08:00
parent 44e360b61b
commit 509ca92f0a
12 changed files with 30 additions and 31 deletions

View File

@@ -7,11 +7,11 @@ import MyIcon from '@/components/Icon';
const ToolMenu = ({ history }: { history: ChatItemType[] }) => {
const { onExportChat } = useChatBox();
const menuList = useRef([
{
icon: 'shareLight',
label: '分享对话',
onClick: () => {}
},
// {
// icon: 'shareLight',
// label: '分享对话',
// onClick: () => {}
// },
{
icon: 'apiLight',
label: 'HTML导出',

View File

@@ -10,12 +10,15 @@ import { useShareChatStore, defaultHistory } from '@/store/shareChat';
import SideBar from '@/components/SideBar';
import { gptMessage2ChatType } from '@/utils/adapt';
import { getErrText } from '@/utils/tools';
import dynamic from 'next/dynamic';
import ChatBox, { type ComponentRef, type StartChatFnProps } from '@/components/ChatBox';
import PageContainer from '@/components/PageContainer';
import ChatHistorySlider from './components/ChatHistorySlider';
import ChatHeader from './components/ChatHeader';
const ChatHistorySlider = dynamic(() => import('./components/ChatHistorySlider'), {
ssr: false
});
const ShareChat = ({ shareId, historyId }: { shareId: string; historyId: string }) => {
const router = useRouter();
const { toast } = useToast();

View File

@@ -17,7 +17,7 @@ const Login = () => {
const { lastRoute = '' } = router.query as { lastRoute: string };
const { isPc } = useGlobalStore();
const [pageType, setPageType] = useState<`${PageTypeEnum}`>(PageTypeEnum.login);
const { setUserInfo, loadKbList, setLastKbId } = useUserStore();
const { setUserInfo } = useUserStore();
const { setLastHistoryId, setLastChatAppId } = useChatStore();
const loginSuccess = useCallback(
@@ -25,15 +25,13 @@ const Login = () => {
// init store
setLastHistoryId('');
setLastChatAppId('');
setLastKbId('');
loadKbList(true);
setUserInfo(res.user);
setTimeout(() => {
router.push(lastRoute ? decodeURIComponent(lastRoute) : '/model');
router.push(lastRoute ? decodeURIComponent(lastRoute) : '/app/list');
}, 100);
},
[lastRoute, loadKbList, router, setLastHistoryId, setLastChatAppId, setLastKbId, setUserInfo]
[lastRoute, router, setLastHistoryId, setLastChatAppId, setUserInfo]
);
function DynamicComponent({ type }: { type: `${PageTypeEnum}` }) {
@@ -48,10 +46,6 @@ const Login = () => {
return <Component setPageType={setPageType} loginSuccess={loginSuccess} />;
}
useEffect(() => {
router.prefetch('/model');
}, [router]);
return (
<Flex
alignItems={'center'}

View File

@@ -6,14 +6,14 @@ import { useRouter } from 'next/router';
const list = [
{
icon: 'kb',
icon: 'dbLight',
label: '我的知识库',
link: '/kb'
link: '/kb/list'
},
{
icon: 'appStore',
icon: 'appStoreLight',
label: 'AI应用市场',
link: '/model/share'
link: '/appStore'
},
{
icon: 'git',