Files
assetx/antdesign/fix-routes.sh

48 lines
1.7 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
echo "🔧 修复 Ant Design Pro 路由问题"
echo "================================"
# 1. 清理缓存
echo "1⃣ 清理缓存..."
rm -rf src/.umi
rm -rf node_modules/.cache
rm -rf .umi
rm -rf .umi-production
# 2. 检查页面文件
echo "2⃣ 检查页面文件..."
echo "✓ Vault/Trade: $(test -f src/pages/Vault/Trade/index.tsx && echo '存在' || echo '❌ 不存在')"
echo "✓ Vault/USDC: $(test -f src/pages/Vault/USDC/index.tsx && echo '存在' || echo '❌ 不存在')"
echo "✓ LP: $(test -f src/pages/LP/index.ts && echo '存在' || echo '❌ 不存在')"
echo "✓ Statistics/Holders: $(test -f src/pages/Statistics/Holders/index.tsx && echo '存在' || echo '❌ 不存在')"
echo "✓ Admin/Factory: $(test -f src/pages/Admin/Factory/index.tsx && echo '存在' || echo '❌ 不存在')"
echo "✓ Admin/Lending: $(test -f src/pages/Admin/Lending/index.tsx && echo '存在' || echo '❌ 不存在')"
echo "✓ Lending/User: $(test -f src/pages/Lending/User/index.tsx && echo '存在' || echo '❌ 不存在')"
# 3. 验证 export default
echo ""
echo "3⃣ 验证 default export..."
for file in src/pages/Vault/Trade/index.tsx src/pages/Vault/USDC/index.tsx src/pages/Admin/Factory/index.tsx src/pages/Admin/Lending/index.tsx src/pages/Lending/User/index.tsx src/pages/Statistics/Holders/index.tsx; do
if [ -f "$file" ]; then
if grep -q "export default" "$file"; then
echo "$file"
else
echo "$file - 缺少 export default"
fi
fi
done
echo ""
echo "4⃣ 重启开发服务器..."
echo "================================"
echo ""
echo "请手动执行:"
echo " pnpm dev"
echo ""
echo "或者:"
echo " npm run dev"
echo ""
echo "然后在浏览器中刷新页面Ctrl+Shift+R 或 Cmd+Shift+R"