mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-16 08:01:18 +00:00
4.8.11 perf (#2832)
* save toast * perf: surya ocr * perf: remove same model name * fix: indexes * perf: ip check * feat: Fixed the version number of the subapplication * feat: simple app get latest child version * perf: update child dispatch variables * feat: variables update doc
This commit is contained in:
@@ -55,17 +55,6 @@ const Login = ({ ChineseRedirectUrl }: { ChineseRedirectUrl: string }) => {
|
||||
defaultValue: true
|
||||
});
|
||||
|
||||
const checkIpInChina = useCallback(
|
||||
() =>
|
||||
GET(ipDetectURL).then((res: any) => {
|
||||
const country = res?.country;
|
||||
if (country && country === '中国' && res.city !== '中国香港') {
|
||||
onOpenRedirect();
|
||||
}
|
||||
}),
|
||||
[onOpenRedirect]
|
||||
);
|
||||
|
||||
const loginSuccess = useCallback(
|
||||
(res: ResLogin) => {
|
||||
// init store
|
||||
@@ -101,10 +90,27 @@ const Login = ({ ChineseRedirectUrl }: { ChineseRedirectUrl: string }) => {
|
||||
);
|
||||
}, [feConfigs.oauth]);
|
||||
|
||||
const checkIpInChina = useCallback(async () => {
|
||||
try {
|
||||
const res = await GET<any>(ipDetectURL);
|
||||
const country = res?.country;
|
||||
if (
|
||||
country &&
|
||||
country === '中国' &&
|
||||
res.prov !== '中国香港' &&
|
||||
res.prov !== '中国澳门' &&
|
||||
res.prov !== '中国台湾'
|
||||
) {
|
||||
onOpenRedirect();
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}, [onOpenRedirect]);
|
||||
useMount(() => {
|
||||
clearToken();
|
||||
ChineseRedirectUrl && showRedirect && checkIpInChina();
|
||||
router.prefetch('/app/list');
|
||||
ChineseRedirectUrl && showRedirect && checkIpInChina();
|
||||
});
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user