mirror of
https://github.com/Silentely/eSIM-Tools.git
synced 2026-09-03 06:24:20 +08:00
♻️ refactor: 废弃 Legacy 前端,统一使用 Modular 版本
- 删除 giffgaff_complete_esim.html 和 simyo_complete_esim.html - 构建脚本自动排除 Legacy HTML 文件 - Netlify 添加 Legacy URL 301 重定向到 Modular 版本 - 移除 verify-legacy-frozen.js 构建检查 - 更新 6 个文档文件中的 Legacy 文件引用 修复 Issue #50: Legacy 前端缺少 simSwapMfaChallenge 步骤导致 500 错误
This commit is contained in:
@@ -23,18 +23,18 @@ Refused to connect to 'https://id.giffgaff.com/auth/oauth/token' because it viol
|
||||
|
||||
```html
|
||||
<meta http-equiv="Content-Security-Policy" content="
|
||||
default-src 'self';
|
||||
script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com;
|
||||
style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com;
|
||||
font-src 'self' https://cdnjs.cloudflare.com;
|
||||
connect-src 'self'
|
||||
https://qrcode.show
|
||||
https://api.qrserver.com
|
||||
https://appapi.simyo.nl
|
||||
https://api.giffgaff.com
|
||||
default-src 'self';
|
||||
script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com;
|
||||
style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com;
|
||||
font-src 'self' https://cdnjs.cloudflare.com;
|
||||
connect-src 'self'
|
||||
https://qrcode.show
|
||||
https://api.qrserver.com
|
||||
https://appapi.simyo.nl
|
||||
https://api.giffgaff.com
|
||||
https://id.giffgaff.com ← 新增
|
||||
https://publicapi.giffgaff.com; ← 新增
|
||||
img-src 'self' data: https:;
|
||||
img-src 'self' data: https:;
|
||||
frame-src 'none';
|
||||
">
|
||||
```
|
||||
@@ -84,7 +84,7 @@ if (callbackUrl.startsWith('giffgaff://')) {
|
||||
|
||||
## 📋 修复的文件
|
||||
|
||||
### `giffgaff_complete_esim.html`
|
||||
### `giffgaff_modular.html`
|
||||
|
||||
1. **CSP配置** (第6行)
|
||||
- 添加了完整的Content Security Policy
|
||||
@@ -178,7 +178,7 @@ console.log('解析到的状态:', state);
|
||||
|
||||
---
|
||||
|
||||
**注意**:
|
||||
**注意**:
|
||||
1. 如果仍有问题,请检查浏览器控制台的详细错误信息
|
||||
2. OAuth授权码有时间限制,需要及时处理回调
|
||||
3. 确保复制的回调URL完整且未被截断
|
||||
3. 确保复制的回调URL完整且未被截断
|
||||
|
||||
@@ -31,21 +31,15 @@ sed -i '' 's|../webfonts/|./|g' src/assets/fontawesome/all.min.css
|
||||
<link rel="stylesheet" href="/src/assets/fontawesome/all.min.css">
|
||||
```
|
||||
|
||||
**src/giffgaff/giffgaff_complete_esim.html:**
|
||||
**src/giffgaff/giffgaff_modular.html:**
|
||||
```html
|
||||
<!-- 修改前 -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
|
||||
<!-- 修改后 -->
|
||||
<!-- 已通过外部样式表加载 Font Awesome -->
|
||||
<link rel="stylesheet" href="/src/assets/fontawesome/all.min.css">
|
||||
```
|
||||
|
||||
**src/simyo/simyo_complete_esim.html:**
|
||||
**src/simyo/simyo_modular.html:**
|
||||
```html
|
||||
<!-- 修改前 -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
|
||||
<!-- 修改后 -->
|
||||
<!-- 已通过外部样式表加载 Font Awesome -->
|
||||
<link rel="stylesheet" href="/src/assets/fontawesome/all.min.css">
|
||||
```
|
||||
|
||||
@@ -80,4 +74,4 @@ src/assets/fontawesome/
|
||||
## 注意事项
|
||||
- 确保字体文件路径正确
|
||||
- 定期更新Font Awesome版本
|
||||
- 在生产环境中验证图标显示
|
||||
- 在生产环境中验证图标显示
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
## 📁 文件说明
|
||||
|
||||
### 主要文件
|
||||
- **`giffgaff_complete_esim.html`** - 完整的eSIM设备更换工具(生产版本)
|
||||
- **`giffgaff_modular.html`** - eSIM设备更换工具(生产版本,模块化架构)
|
||||
- **`test_giffgaff_esim.html`** - 综合测试页面(开发/测试版本)
|
||||
- **`Giffgaff-swap-esim.json`** - 原始Postman脚本(参考文档)
|
||||
- **`giffgaff.html`** - 原有的简化版本(参考)
|
||||
|
||||
@@ -18,7 +18,7 @@ This is a complete web application that allows existing Giffgaff subscribers to
|
||||
## 📁 File Description
|
||||
|
||||
### Main Files
|
||||
- **`giffgaff_complete_esim.html`** - Complete eSIM Device Change Tool (Production Version)
|
||||
- **`giffgaff_modular.html`** - eSIM Device Change Tool (Production Version, Modular Architecture)
|
||||
- **`test_giffgaff_esim.html`** - Comprehensive Test Page (Development/Test Version)
|
||||
- **`Giffgaff-swap-esim.json`** - Original Postman Script (Reference Document)
|
||||
- **`giffgaff.html`**** - Original Simplified Version (Reference)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
## 📁 文件说明
|
||||
|
||||
### 主要文件
|
||||
- **`simyo_complete_esim.html`** - 完整的 Simyo eSIM 设备更换工具(生产版本)
|
||||
- **`simyo_modular.html`** - Simyo eSIM 设备更换工具(生产版本,模块化架构)
|
||||
- **`test_simyo_esim.html`** - 综合测试页面(开发/测试版本)
|
||||
- **`Simyo ESIM V2.postman_collection.json`** - 原始Postman脚本(参考文档)
|
||||
- **`simyo.html`** - 原有的简化版本(参考)
|
||||
|
||||
@@ -18,7 +18,7 @@ This is a web application designed specifically for Simyo NL (Netherlands) users
|
||||
## 📁 File Description
|
||||
|
||||
### Main Files
|
||||
- **`simyo_complete_esim.html`** - Complete Simyo eSIM Device Change Tool (Production Version)
|
||||
- **`simyo_modular.html`** - Simyo eSIM Device Change Tool (Production Version, Modular Architecture)
|
||||
- **`test_simyo_esim.html`** - Comprehensive Test Page (Development/Test Version)
|
||||
- **`Simyo ESIM V2.postman_collection.json`** - Original Postman Script (Reference Document)
|
||||
- **`simyo.html`** - Original Simplified Version (Reference)
|
||||
|
||||
11
netlify.toml
11
netlify.toml
@@ -27,6 +27,17 @@
|
||||
to = "/src/simyo/simyo_modular.html"
|
||||
status = 200
|
||||
|
||||
# Legacy 页面重定向到 Modular 版本(废弃 Legacy 前端)
|
||||
[[redirects]]
|
||||
from = "/src/giffgaff/giffgaff_complete_esim.html"
|
||||
to = "/src/giffgaff/giffgaff_modular.html"
|
||||
status = 301
|
||||
|
||||
[[redirects]]
|
||||
from = "/src/simyo/simyo_complete_esim.html"
|
||||
to = "/src/simyo/simyo_modular.html"
|
||||
status = 301
|
||||
|
||||
[[redirects]]
|
||||
# 根路径重定向到选择页面
|
||||
from = "/"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"start": "node server.js",
|
||||
"dev": "nodemon server.js",
|
||||
"build": "npm run build:static",
|
||||
"build:static": "node scripts/verify-legacy-frozen.js && node scripts/build-static.js",
|
||||
"build:static": "node scripts/build-static.js",
|
||||
"verify:legacy": "node scripts/verify-legacy-frozen.js",
|
||||
"verify:legacy:update": "node scripts/verify-legacy-frozen.js --update",
|
||||
"test": "jest",
|
||||
|
||||
@@ -91,6 +91,18 @@ async function copyDirectory(source, destination) {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除 Legacy HTML 文件(已废弃,统一使用 Modular 版本)
|
||||
const legacyHtmlFiles = [
|
||||
path.join(distDir, 'src', 'giffgaff', 'giffgaff_complete_esim.html'),
|
||||
path.join(distDir, 'src', 'simyo', 'simyo_complete_esim.html')
|
||||
];
|
||||
for (const f of legacyHtmlFiles) {
|
||||
if (fs.existsSync(f)) {
|
||||
await fs.promises.unlink(f);
|
||||
BuildLogger.log(`🗑️ 已删除 Legacy 文件: ${path.relative(projectRoot, f)}`);
|
||||
}
|
||||
}
|
||||
|
||||
BuildLogger.log('🧩 转译 dist/src 下的 JS(browserslist 目标)...');
|
||||
await transpileDistJs();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user