From fff5c59776a7cc8355607ef4c67978dfb45053ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Fri, 28 Aug 2026 16:36:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E8=B5=8B=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/game-api.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/assets/game-api.js b/assets/game-api.js index 267fdec..58e8669 100644 --- a/assets/game-api.js +++ b/assets/game-api.js @@ -17,16 +17,14 @@ const _isDevPort = (port) => (port === 80 && (location.port === '' || location.port === '80')); const API_CONFIG = { - // 本地开发一律跨域直连 Odoo 8069(python http.server 无代理能力); - // 仅 8080 dev-server(自带反向代理到 Odoo)才走同源空 base。 base: _isLocalDev() - ? (_isDevPort(8080) ? '' : `http://${location.hostname}:8069`) - : '', - db: _isLocalDev() ? 'game_a' : 'game', + ? ((_isDevPort(8080) || _isDevPort(8888)) ? '' : `http://${location.hostname}:8080`) + : '', + db: _isLocalDev() ? 'study' : 'game', }; -// 世界(yt_world)所在库:与 API_CONFIG.db 保持一致(本地均为 game_a),避免跨库导致 auth 失败。 -const WORLD_DB = API_CONFIG.db; +// 世界(yt_world)所在库:本地 Odoo 钉 yt_game;线上游戏库名为 game。按域名自适应,git 同步不冲突。 +const WORLD_DB = _isLocalDev() ? 'yt_game' : 'game'; // Odoo 后端基础 URL(世界 API 专用,兼容本地跨域 / 生产同域) const WORLD_BASE = API_CONFIG.base || '';