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:
Archer
2024-09-28 15:31:25 +08:00
committed by GitHub
parent f7a8203454
commit f2749cbb00
34 changed files with 393 additions and 263 deletions

View File

@@ -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 (