fix(page-data): harden structural delivery and Portal base URL

Reject /api/page-data/ legacy passthrough, verify live API before send,
and resolve delivery links to Portal (8081) instead of Vite (5173).
Add local repair/verify scripts for daily-register Page Data flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-13 09:35:40 +08:00
parent 249b0697cb
commit 804f13bc04
11 changed files with 712 additions and 51 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ import { normalizePageAccessPolicy } from './page-access-policy.mjs';
import { upsertPageDataPolicyIndex } from './page-data-policy-index.mjs';
import { syncPageDataPolicyAccessMode } from './page-data-publish-sync.mjs';
import { createMindSpacePublicUrl } from './mindspace-canonical-url.mjs';
import { resolvePublicBaseUrl } from './user-publish.mjs';
import { resolvePageDataDeliveryBaseUrl } from './user-publish.mjs';
import { createUserDataSpaceService } from './user-data-space-service.mjs';
import {
assertPolicyMatchesHtmlDatasets,
@@ -127,7 +127,7 @@ async function ensureWorkspaceHtmlPublished({
}
function buildWorkspacePublicUrl(userId, relativePath) {
const publicBaseUrl = resolvePublicBaseUrl();
const publicBaseUrl = resolvePageDataDeliveryBaseUrl();
return createMindSpacePublicUrl({
publicBaseUrl,
ownerKey: userId,