fix: MindSpace remote sync, thumbnail fallback, and Plaza URL guards
Ensure page sync runs via pageSyncService in remote mode, fall back to workspace HTML when storage assets are missing, and prevent production Portal from linking to loopback Plaza URLs baked in at build time. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -81,7 +81,18 @@ async function writeFile(targetPath, content) {
|
||||
async function buildFrontend() {
|
||||
if (skipBuild) return;
|
||||
console.log('==> 构建 Portal 前端 dist');
|
||||
await run('npm', ['run', 'build']);
|
||||
const buildEnv = {
|
||||
...process.env,
|
||||
VITE_PLAZA_BASE:
|
||||
process.env.VITE_PLAZA_BASE ??
|
||||
process.env.PLAZA_PUBLIC_BASE ??
|
||||
'https://plaza.tkmind.cn',
|
||||
VITE_MINDSPACE_BASE:
|
||||
process.env.VITE_MINDSPACE_BASE ??
|
||||
process.env.H5_PUBLIC_BASE_URL ??
|
||||
'https://m.tkmind.cn',
|
||||
};
|
||||
await run('npm', ['run', 'build'], { env: buildEnv });
|
||||
}
|
||||
|
||||
async function bundleServer() {
|
||||
@@ -397,6 +408,11 @@ async function writeMetadata() {
|
||||
' TKMIND_API_TARGETS / TKMIND_API_TARGET / TKMIND_API_TARGET_1',
|
||||
' H5_USERS_ROOT / MINDSPACE_STORAGE_ROOT / MEMIND_SHARED_PUBLISH_ROOT',
|
||||
'',
|
||||
'Frontend compile-time public URLs (baked into dist at build):',
|
||||
' VITE_PLAZA_BASE defaults to https://plaza.tkmind.cn in build-portal-runtime.mjs',
|
||||
' VITE_MINDSPACE_BASE defaults to H5_PUBLIC_BASE_URL or https://m.tkmind.cn',
|
||||
' Do not build production dist with VITE_PLAZA_BASE=http://127.0.0.1:* in .env',
|
||||
'',
|
||||
'Deployment and operations transport:',
|
||||
' H5 public domain: m.tkmind.cn',
|
||||
' Current public path: m.tkmind.cn -> 105 nginx -> 103 Portal :8081',
|
||||
|
||||
Reference in New Issue
Block a user