mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix(cloudflare): get env
This commit is contained in:
parent
d3936ff307
commit
bc6566a363
@ -48,7 +48,7 @@ export default async function LocaleLayout({
|
|||||||
return (
|
return (
|
||||||
<html lang={locale} suppressHydrationWarning>
|
<html lang={locale} suppressHydrationWarning>
|
||||||
<head>
|
<head>
|
||||||
{!process.env.VERCEL && !process.env.CF_PAGES && <PublicEnvScript />}
|
{!process.env.VERCEL && <PublicEnvScript />}
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.0.0/css/flag-icons.min.css"
|
href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.0.0/css/flag-icons.min.css"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { env } from "next-runtime-env";
|
import { env } from "next-runtime-env";
|
||||||
|
|
||||||
export default function getEnv(key: string) {
|
export default function getEnv(key: string) {
|
||||||
if (process.env.VERCEL || process.env.CF_PAGES) {
|
if (process.env.VERCEL) {
|
||||||
return process.env[key];
|
return process.env[key];
|
||||||
} else {
|
} else {
|
||||||
if (key.startsWith("NEXT_PUBLIC_")) {
|
if (key.startsWith("NEXT_PUBLIC_")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user