This commit is contained in:
parent
65310bc613
commit
0bce0eed07
|
|
@ -25,7 +25,8 @@ export async function getRuntimeEnv(key: string): Promise<string | undefined> {
|
||||||
// 2. 第3次开始查localStorage兜底
|
// 2. 第3次开始查localStorage兜底
|
||||||
if (retries >= 2) {
|
if (retries >= 2) {
|
||||||
const cached = window.localStorage.getItem(LOCAL_KEY);
|
const cached = window.localStorage.getItem(LOCAL_KEY);
|
||||||
const cachedIp = extractIp(cached);
|
const cachedIp = extractIp(cached ?? undefined);
|
||||||
|
//const cachedIp = extractIp(cached);
|
||||||
if (cachedIp && key === "SUPABASE_URL") {
|
if (cachedIp && key === "SUPABASE_URL") {
|
||||||
console.warn(`[env] [${key}] 第${retries}次重试后window.RUNTIME_ENV还没拿到合法IP,localStorage兜底: ${cached},提取IP: ${cachedIp}`);
|
console.warn(`[env] [${key}] 第${retries}次重试后window.RUNTIME_ENV还没拿到合法IP,localStorage兜底: ${cached},提取IP: ${cachedIp}`);
|
||||||
return cachedIp;
|
return cachedIp;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue