perf: qa
This commit is contained in:
@@ -31,7 +31,7 @@ const queryClient = new QueryClient({
|
||||
});
|
||||
|
||||
function App({ Component, pageProps, isPc }: AppProps & { isPc?: boolean; response: any }) {
|
||||
const [googleVerKey, setGoogleVerKey] = useState<string>();
|
||||
const [googleClientVerKey, setGoogleVerKey] = useState<string>();
|
||||
const [baiduTongji, setBaiduTongji] = useState<string>();
|
||||
const { initIsPc } = useGlobalStore();
|
||||
|
||||
@@ -42,9 +42,9 @@ function App({ Component, pageProps, isPc }: AppProps & { isPc?: boolean; respon
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
const {
|
||||
systemEnv: { googleVerKey, baiduTongji }
|
||||
systemEnv: { googleClientVerKey, baiduTongji }
|
||||
} = await clientInitData();
|
||||
setGoogleVerKey(googleVerKey);
|
||||
setGoogleVerKey(googleClientVerKey);
|
||||
setBaiduTongji(baiduTongji);
|
||||
})();
|
||||
}, []);
|
||||
@@ -65,10 +65,10 @@ function App({ Component, pageProps, isPc }: AppProps & { isPc?: boolean; respon
|
||||
<Script src="/js/pdf.js" strategy="lazyOnload"></Script>
|
||||
<Script src="/js/html2pdf.bundle.min.js" strategy="lazyOnload"></Script>
|
||||
{baiduTongji && <Script src={baiduTongji} strategy="lazyOnload"></Script>}
|
||||
{googleVerKey && (
|
||||
{googleClientVerKey && (
|
||||
<>
|
||||
<Script
|
||||
src={`https://www.recaptcha.net/recaptcha/api.js?render=${googleVerKey}`}
|
||||
src={`https://www.recaptcha.net/recaptcha/api.js?render=${googleClientVerKey}`}
|
||||
strategy="afterInteractive"
|
||||
></Script>
|
||||
</>
|
||||
|
||||
@@ -23,9 +23,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
}
|
||||
|
||||
// google auth
|
||||
process.env.SERVICE_GOOGLE_VER_TOKEN &&
|
||||
global.systemEnv.googleServiceVerKey &&
|
||||
(await authGoogleToken({
|
||||
secret: process.env.SERVICE_GOOGLE_VER_TOKEN,
|
||||
secret: global.systemEnv.googleServiceVerKey,
|
||||
response: googleToken,
|
||||
remoteip: requestIp.getClientIp(req) || undefined
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user