From e9873040f394873ac48d9ea9a7a67fea7c0cb1f4 Mon Sep 17 00:00:00 2001 From: Karlcarlo Date: Sun, 20 Sep 2026 01:48:16 +0800 Subject: [PATCH] =?UTF-8?q?mama-box:=20=E8=A7=92=E6=A0=87=E6=94=B9?= =?UTF-8?q?=E8=B0=83=20/api/mp/public/laixin/unread=EF=BC=88=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=91=BD=E5=90=8D=E8=A7=84=E8=8C=83=EF=BC=89+=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20v26092002?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按 box_app/docs/api-naming-convention.md:box_app 对外暴露某应用的数据一律走 /api/mp/public//<资源>,app 段 = App 表 identifier。原先调的是 /api/mp/public/mama-box/laixin/unread,与妈妈盒子自己的来信(mama-box/letters) 同处一个命名空间、容易混,已随之迁到 laixin 命名空间。 --- index.html | 2 +- js/app.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 93c36e1..e8fc719 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ 兜爸心选 · 孕育陪伴 - + diff --git a/js/app.js b/js/app.js index c4bbf30..c6d0615 100644 --- a/js/app.js +++ b/js/app.js @@ -3,7 +3,7 @@ (function () { 'use strict'; /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ - var VER = '26092001'; + var VER = '26092002'; const $ = (s, c) => (c || document).querySelector(s); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); @@ -4310,8 +4310,11 @@ $('#tabLetter').addEventListener('click', openLetterApp); /* ---------- 底 tab 角标:宝宝来信未读数 ---------- - 数据源:box_app 封装的联动接口 GET /api/mp/public/mama-box/laixin/unread + 数据源:box_app 封装的联动接口 GET /api/mp/public/laixin/unread (box_app 后端再去调第三方 https://taidong.douba.top/laixin/api/laixin/unread)。 + ⚠️ 路径按应用命名空间走 /api/mp/public//<资源>(app 段 = App 表 identifier), + 不要塞回 /mama-box/ 命名空间 —— 妈妈盒子自己也有一套来信(mama-box/letters), + 两套数据必须靠 app 段隔开。规则见 box_app/docs/api-naming-convention.md。 ⚠️ 为什么不直连 taidong:那台的 CORS 白名单只放了自己的域名,页面直连会被浏览器拦; 而且「mama-box ↔ laixin 的联动接口由 box_app 封装」是本项目的既定边界 (见 docs/mama-box-change-list-20260919.md §1.5)。 @@ -4329,7 +4332,7 @@ const unionid = hashParam('unionid'); const qs = 'openid=' + encodeURIComponent(openid) + (unionid ? '&unionid=' + encodeURIComponent(unionid) : ''); - fetch('/api/mp/public/mama-box/laixin/unread?' + qs) + fetch('/api/mp/public/laixin/unread?' + qs) .then(r => (r.ok ? r.json() : null)) .then(j => { const r = j && j.result;