mama-box: 角标改调 /api/mp/public/laixin/unread(接口命名规范)+ 版本 v26092002

按 box_app/docs/api-naming-convention.md:box_app 对外暴露某应用的数据一律走
/api/mp/public/<app>/<资源>,app 段 = App 表 identifier。原先调的是
/api/mp/public/mama-box/laixin/unread,与妈妈盒子自己的来信(mama-box/letters)
同处一个命名空间、容易混,已随之迁到 laixin 命名空间。
This commit is contained in:
2026-09-20 01:48:16 +08:00
parent aa53d5c6e6
commit e9873040f3
2 changed files with 7 additions and 4 deletions

View File

@@ -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 段 = 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;