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

@@ -7,7 +7,7 @@
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<title>兜爸心选 · 孕育陪伴</title> <title>兜爸心选 · 孕育陪伴</title>
<!-- V:26092001 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 --> <!-- V:26092002 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<link rel="stylesheet" href="mama-box.css"> <link rel="stylesheet" href="mama-box.css">
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- 共享助手:授权/跳商城/位置上报(分享卡片同步,见 docs/h5-auth-standard.md 第四节) --> <!-- 共享助手:授权/跳商城/位置上报(分享卡片同步,见 docs/h5-auth-standard.md 第四节) -->

View File

@@ -3,7 +3,7 @@
(function () { (function () {
'use strict'; 'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26092001'; var VER = '26092002';
const $ = (s, c) => (c || document).querySelector(s); const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -4310,8 +4310,11 @@
$('#tabLetter').addEventListener('click', openLetterApp); $('#tabLetter').addEventListener('click', openLetterApp);
/* ---------- 底 tab 角标:宝宝来信未读数 ---------- /* ---------- 底 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)。 (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 白名单只放了自己的域名,页面直连会被浏览器拦; ⚠️ 为什么不直连 taidong:那台的 CORS 白名单只放了自己的域名,页面直连会被浏览器拦;
而且「mama-box ↔ laixin 的联动接口由 box_app 封装」是本项目的既定边界 而且「mama-box ↔ laixin 的联动接口由 box_app 封装」是本项目的既定边界
(见 docs/mama-box-change-list-20260919.md §1.5)。 (见 docs/mama-box-change-list-20260919.md §1.5)。
@@ -4329,7 +4332,7 @@
const unionid = hashParam('unionid'); const unionid = hashParam('unionid');
const qs = 'openid=' + encodeURIComponent(openid) + const qs = 'openid=' + encodeURIComponent(openid) +
(unionid ? '&unionid=' + encodeURIComponent(unionid) : ''); (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(r => (r.ok ? r.json() : null))
.then(j => { .then(j => {
const r = j && j.result; const r = j && j.result;