档案/消消乐/婴儿房/兜豆商城入口去掉域名,改同源相对路径 (v26100906)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 14:28:26 +00:00
parent d6904f364a
commit 835bd39a2d
2 changed files with 11 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26100905';
var VER = '26100906';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -184,6 +184,7 @@
function reportLastApp(url, identifier) {
try {
if (!url) return;
url = new URL(url, location.origin).href; // 2026-10-09 入口改相对路径后,上报仍用完整地址(服务端按 URL 前缀反查 App 表)
const oid = hashParam('openid');
if (!oid) return; // 没有身份键,服务端无法落到 per-openid 记录:跳过(不影响跳转)
const qs = ['openid=' + encodeURIComponent(oid), 'url=' + encodeURIComponent(url)];
@@ -279,7 +280,7 @@
/* 2026-10-01 用户要求「档案」Tab 改跳孕期档案 H5(会话 19875b1b 提供)。
⚠️ 对方说明:目前是设计演示版(写死演示数据),还不读 URL 参数;接真实数据时按 ?openid=&unionid= 读,
所以这里照旧拼上。无 return_url,返回靠宿主自带返回。原来跳的是 /chanjian-rili/(孕检日历)。 */
const ARCHIVE_H5 = 'https://mp.yizhezhe.com/chengzhang-dangan/v8/'; // 2026-10-04 v7 → v8(会话 19875b1b 要求;正式入口不带 ?demo=1,带了只出示例数据);2026-10-09 改走 mp 业务域名反代
const ARCHIVE_H5 = '/chengzhang-dangan/v8/'; // 2026-10-04 v7 → v8(会话 19875b1b 要求;正式入口不带 ?demo=1,带了只出示例数据);2026-10-09 改同源相对路径(mp nginx 反代)
function goArchiveH5() {
const oid = hashParam('openid');
const uid = hashParam('unionid');
@@ -3409,9 +3410,9 @@
/* ================= 宝宝消消乐 · 推广入口(2026-09-30) =================
GAME_URL 为空 → 入口不显示。小棋盘:每 2.6 秒随机一行/一列先亮一下,再「消掉」换一批新的掉下来。 */
/* 2026-10-09 用户:消消乐改调「首页 / 宝宝消消乐」会话(80d347e2)那版。正式版,2026-10-08 上线。
最终地址 https://mp.yizhezhe.com/muying-xiaoxiao/(mp 前置机白名单未加,目前 404),通了只换域名。
2026-10-09 mp nginx 已加 /muying-xiaoxiao/ 反代 → 改同源相对路径。
对方不读 URL 参数(进度、兜豆按设备号存在浏览器本地),带身份参数无害;没有完成回传接口。 */
const GAME_URL = 'https://mp.yizhezhe.com/muying-xiaoxiao/'; // 2026-10-09 mp nginx 已加反代
const GAME_URL = '/muying-xiaoxiao/'; // 2026-10-09 同源相对路径(mp nginx 反代到 taidong)
const GAME_ID = 'baobao-xiaoxiaole';
(function gamePromo() {
const sec = $('#gamePromo'), board = $('#gpBoard');
@@ -3438,9 +3439,8 @@
/* ================= 3D 婴儿房 · 页面上的一道空隙(2026-10-01 三版)=================
设计写在 index.html 的 #nursery 注释里。地址由「首页 / 3D婴儿房」会话(6a7224a5)维护;
带 return_url(首页净地址,不含 hash),对方返回按钮读到就跳回来(只放行 *.yizhezhe.com / *.douba.top)。syncPregnancy() 每次都会调 nurseryRender()。
2026-10-09 用户:房子链接改成 6a7224a5 会话那版 → taidong 预览域名;正式地址将是 https://mp.yizhezhe.com/yinger-fang/
(目前 404,等 mp 前置机白名单),到时只换域名、路径参数不变。 */
const NURSERY_URL = 'https://mp.yizhezhe.com/yinger-fang/'; // 2026-10-09 mp nginx 已加反代
2026-10-09 用户:房子链接改成 6a7224a5 会话那版;同日 mp nginx 加了 /yinger-fang/ 反代 → 改同源相对路径。 */
const NURSERY_URL = '/yinger-fang/'; // 2026-10-09 同源相对路径(mp nginx 反代到 taidong)
const NURSERY_ID = 'yef-nursery';
function nurseryRender() {
if (!$('#nursery')) return;
@@ -5142,7 +5142,9 @@
· 跳转走 jumpApp()(query 带 openid/unionid),另带 return_url —— 商城左上角出返回按钮。
· 应用后台若配了同名应用(EXCH_IDS 里任一 identifier),以后台 URL 为准。 */
const EXCH_IDS = ['doudou-duihuan', 'doudouduihuan', 'duihuan'];
const EXCH_URL = 'https://mp.yizhezhe.com/doudou-duihuan/'; // 2026-10-09 改走业务域名反代(页面 + /api 都在目录下)
/* 2026-10-09 用户:「首页的链接去掉域名,避免跨域」→ 同源相对路径。页面和 /api 都在目录下,mp nginx 反代到 taidong;
兜豆接口(openid-login / summary / drop)因此变成同源请求,不再跨域。 */
const EXCH_URL = '/doudou-duihuan/';
const DOU_API = EXCH_URL + 'api';
/* page:可选,'orders' = 直接弹商城的「兑换记录」(2026-10-05 商城会话 cc4ca879 提供 ?page=orders;
带 return_url 时点 × 直接回首页,不带只关面板留在商城)。 */