mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 00:17:31 +00:00
fix: ssr
This commit is contained in:
@@ -22,6 +22,11 @@ export const streamFetch = ({ data, onMessage, abortSignal }: StreamFetchProps)
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (response.status !== 200) {
|
||||||
|
const err = await response.json();
|
||||||
|
return reject(err);
|
||||||
|
}
|
||||||
|
|
||||||
if (!response?.body) {
|
if (!response?.body) {
|
||||||
throw new Error('Request Error');
|
throw new Error('Request Error');
|
||||||
}
|
}
|
||||||
@@ -98,7 +103,8 @@ export const streamFetch = ({ data, onMessage, abortSignal }: StreamFetchProps)
|
|||||||
};
|
};
|
||||||
read();
|
read();
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.log(err, '====');
|
console.log(err);
|
||||||
|
|
||||||
reject(getErrText(err, '请求异常'));
|
reject(getErrText(err, '请求异常'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -7,15 +7,16 @@ import dynamic from 'next/dynamic';
|
|||||||
import Tabs from '@/components/Tabs';
|
import Tabs from '@/components/Tabs';
|
||||||
|
|
||||||
import Settings from './components/Settings';
|
import Settings from './components/Settings';
|
||||||
|
import { defaultModel } from '@/constants/model';
|
||||||
|
|
||||||
const Kb = dynamic(() => import('./components/Kb'), {
|
const Kb = dynamic(() => import('./components/Kb'), {
|
||||||
ssr: true
|
ssr: false
|
||||||
});
|
});
|
||||||
const Share = dynamic(() => import('./components/Share'), {
|
const Share = dynamic(() => import('./components/Share'), {
|
||||||
ssr: true
|
ssr: false
|
||||||
});
|
});
|
||||||
const API = dynamic(() => import('./components/API'), {
|
const API = dynamic(() => import('./components/API'), {
|
||||||
ssr: true
|
ssr: false
|
||||||
});
|
});
|
||||||
|
|
||||||
enum TabEnum {
|
enum TabEnum {
|
||||||
@@ -28,7 +29,7 @@ enum TabEnum {
|
|||||||
const ModelDetail = ({ modelId }: { modelId: string }) => {
|
const ModelDetail = ({ modelId }: { modelId: string }) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { isPc } = useGlobalStore();
|
const { isPc } = useGlobalStore();
|
||||||
const { modelDetail, userInfo } = useUserStore();
|
const { modelDetail = defaultModel, userInfo } = useUserStore();
|
||||||
const [currentTab, setCurrentTab] = useState<`${TabEnum}`>(TabEnum.settings);
|
const [currentTab, setCurrentTab] = useState<`${TabEnum}`>(TabEnum.settings);
|
||||||
|
|
||||||
const isOwner = useMemo(
|
const isOwner = useMemo(
|
||||||
|
Reference in New Issue
Block a user