dsh-plugin-wallpaper-engine-mascot-avatar 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* `mascot-avatar` 子包宿主入口(P-F 第二格:`lib/components/mascot-avatar/` → `packages/mascot-avatar/`)。
|
|
3
3
|
*
|
|
4
4
|
* 为什么这两族合成**一格**出户:它们是同一套形态的两条腿(POST 导入 raw body + MIME 白名单 /
|
|
5
|
-
* GET·HEAD 查看 / DELETE 清除,见本包
|
|
5
|
+
* GET·HEAD 查看 / DELETE 清除,见本包 `./routes/avatar.js` 与 `packages/mascot-avatar/lib/routes/mascot.js` 的文件头),
|
|
6
6
|
* 共用同一批内核服务层符号(目录 / 上限 / 原子落盘 / 请求收尾)与同一条用户资产语义。拆成两行
|
|
7
7
|
* 只会让"头像两个 side + 立绘只有一张"这套不变量散在两处。
|
|
8
8
|
*
|
|
@@ -96,7 +96,7 @@ export function applyImpl(root, _rawConfig, c) {
|
|
|
96
96
|
// 两条装载路径都能这么读:① 子包行自己声明了 `inject = ['webServer', 'wallpaperEngineHost']`;
|
|
97
97
|
// ② 门面路径的 `root` 就是门面的 ctx,而门面同样声明了 `inject = ['webServer']`(主行
|
|
98
98
|
// `lib/index.js` 的 `inject` 声明)。
|
|
99
|
-
const webServer = root && root.webServer;
|
|
99
|
+
const webServer = keys.tolerantWebServer(root && root.webServer);
|
|
100
100
|
// 与门面 `apply()` 同款早退:服务在、但 register 面还没挂上(或换成了别的 webServer 实现)。
|
|
101
101
|
if (!webServer || typeof webServer.register !== 'function') return () => {};
|
|
102
102
|
|
|
@@ -120,7 +120,7 @@ export function applyImpl(root, _rawConfig, c) {
|
|
|
120
120
|
// (`runComponent()` 只在 impl 正常返回时拿到它)⇒ 残留路由让下一次启用撞
|
|
121
121
|
// `webserver: duplicate … route`。teardown 自己吞异常,原错照抛(装载失败必须仍然是红的)。
|
|
122
122
|
try {
|
|
123
|
-
// 6f. 「系统」页签的自定义吉祥物立绘 → lib/routes/mascot.js。POST 导入(raw body + MIME 白名单)/
|
|
123
|
+
// 6f. 「系统」页签的自定义吉祥物立绘 → packages/mascot-avatar/lib/routes/mascot.js。POST 导入(raw body + MIME 白名单)/
|
|
124
124
|
// GET·HEAD 查看 / DELETE 清除,只认一张:导入前先清同族旧文件("下一次导入覆盖上一次")。
|
|
125
125
|
registerMascotRoutes(webServer, {
|
|
126
126
|
...keys, disposers, base, serveFile, http: keys.http,
|
|
@@ -128,7 +128,7 @@ export function applyImpl(root, _rawConfig, c) {
|
|
|
128
128
|
atomicWriteFileP, armBodyIdleTimeout, lingerClose,
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
// 6e. 「扩展」页签第一个模块(自定义会话头像)的两张图 → lib/routes/avatar.js。一条 prefix 注册
|
|
131
|
+
// 6e. 「扩展」页签第一个模块(自定义会话头像)的两张图 → packages/mascot-avatar/lib/routes/avatar.js。一条 prefix 注册
|
|
132
132
|
// 覆盖三个端点;图落在插件数据目录的 `avatars/` 下(不进 overrides,也不进 uploads)。
|
|
133
133
|
registerAvatarRoutes(webServer, {
|
|
134
134
|
...keys, disposers, base, serveFile, http: keys.http,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-wallpaper-engine-mascot-avatar",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Mascot & avatar host half: the custom mascot image (/mascot) and the two session avatars (/avatar/<side>).",
|
|
5
5
|
"icon": "./icon.png",
|
|
6
6
|
"type": "module",
|