兼容两个网络环境
Context testing / run-01 (push) Successful in 35s Details
Context testing / run-02 (push) Successful in 2m2s Details
Context testing / run-03 (push) Successful in 1m28s Details
Context testing / run-04 (push) Successful in 2m53s Details
Context testing / dump_contexts_to_log (push) Successful in 38s Details

This commit is contained in:
谢思 2026-06-10 10:15:22 +08:00
parent f2df4abe9b
commit b2b1a8100a
2 changed files with 6 additions and 2 deletions

View File

@ -50,7 +50,9 @@ function beforeFetch(actionUrl){
return service;
}
let settings = localStorage.chromesetting&& localStorage.chromesetting !=="undefined"&& JSON.parse(localStorage.chromesetting);
let actionUrl = settings && settings.common.zone +'/zoneAdmin/api';
// 根据当前IP判断使用哪个zone配置
const isSpecificIP = window.location.hostname.startsWith('27.');
let actionUrl = settings && (isSpecificIP ? settings.common.zone : settings.common.zone_local) + '/zoneAdmin/api';
const service = beforeFetch(actionUrl);
export const httpUrl = actionUrl;

View File

@ -1,7 +1,9 @@
import javaFetch from '../forge/javaFetch';
let settings = localStorage && localStorage.chromesetting && localStorage.chromesetting !=="undefined" && JSON.parse(localStorage.chromesetting);
let actionUrl = (settings && settings.common.forums) || 'http://172.20.32.203:4001';
// 根据当前IP判断使用哪个zone配置
const isSpecificIP = window.location.hostname.startsWith('27.');
let actionUrl = (settings && (isSpecificIP ? settings.common.forums : settings.common.forums_local)) || 'http://172.20.32.203:4001';
const service = javaFetch(actionUrl);
export const httpUrl = actionUrl;