- 小程序页面迁移到 pkg-health/pkg-mall/pkg-profile 分包目录 - 删除旧 pages/health/input、pages/mall/detail 等旧路径 - 导航路径更新为分包路径(/pages/pkg-mall/exchange/index 等) - TrendChart 组件优化 - 后台添加 admin_list_products API(支持查看已下架商品) - config/index.ts 添加 defineConstants 环境变量 - mp e2e check-readiness 路径修正
19 lines
614 B
TypeScript
19 lines
614 B
TypeScript
// apps/miniprogram/e2e/check-readiness.ts
|
|
async function check(url: string, label: string) {
|
|
for (let i = 0; i < 5; i++) {
|
|
try {
|
|
const res = await fetch(url);
|
|
if (res.ok) return;
|
|
} catch { /* retry */ }
|
|
console.log(`⏳ ${label} 未就绪 (${i + 1}/5)...`);
|
|
await new Promise((r) => setTimeout(r, 2000));
|
|
}
|
|
throw new Error(`❌ ${label} 未就绪: ${url}`);
|
|
}
|
|
|
|
export default async function setup() {
|
|
const apiBase = process.env.E2E_API_URL || 'http://localhost:3000';
|
|
await check(`${apiBase}/api/v1/health`, '后端 API');
|
|
console.log('✅ 小程序 E2E 环境就绪');
|
|
}
|