From 9a8372baec20dac3f80f0052bfee0f40518f61b3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 2 Sep 2025 07:02:10 +0000 Subject: [PATCH 1/2] Add CORS support for tyo.tobenot.top domain Co-authored-by: sorrust --- deploy/pm2/ecosystem.config.js | 1 + src/config/cors.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/deploy/pm2/ecosystem.config.js b/deploy/pm2/ecosystem.config.js index f0d1c40..a5dcc16 100644 --- a/deploy/pm2/ecosystem.config.js +++ b/deploy/pm2/ecosystem.config.js @@ -11,6 +11,7 @@ module.exports = { max_memory_restart: '512M', env: { NODE_ENV: 'production', + CORS_ADDITIONAL_ORIGINS: 'https://tyo.tobenot.top', }, out_file: `/var/log/${pkg.name.replace(/^@.*\//, '')}/out.log`, error_file: `/var/log/${pkg.name.replace(/^@.*\//, '')}/err.log`, diff --git a/src/config/cors.ts b/src/config/cors.ts index b70f39c..67e53c5 100644 --- a/src/config/cors.ts +++ b/src/config/cors.ts @@ -27,6 +27,7 @@ export function getCorsConfig(): CorsConfig { 'http://127.0.0.1:5174', 'https://tobenot.top', 'https://bwb.tobenot.top', + 'https://tyo.tobenot.top', // 添加你的后端域名 ]; // 从环境变量添加额外的CORS域名 From bf6cab04d2a00361639cf0fa1a9d464a14c4a4b5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 2 Sep 2025 07:10:42 +0000 Subject: [PATCH 2/2] Remove hardcoded CORS origin from config files Co-authored-by: sorrust --- deploy/pm2/ecosystem.config.js | 1 - src/config/cors.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/deploy/pm2/ecosystem.config.js b/deploy/pm2/ecosystem.config.js index a5dcc16..f0d1c40 100644 --- a/deploy/pm2/ecosystem.config.js +++ b/deploy/pm2/ecosystem.config.js @@ -11,7 +11,6 @@ module.exports = { max_memory_restart: '512M', env: { NODE_ENV: 'production', - CORS_ADDITIONAL_ORIGINS: 'https://tyo.tobenot.top', }, out_file: `/var/log/${pkg.name.replace(/^@.*\//, '')}/out.log`, error_file: `/var/log/${pkg.name.replace(/^@.*\//, '')}/err.log`, diff --git a/src/config/cors.ts b/src/config/cors.ts index 67e53c5..b70f39c 100644 --- a/src/config/cors.ts +++ b/src/config/cors.ts @@ -27,7 +27,6 @@ export function getCorsConfig(): CorsConfig { 'http://127.0.0.1:5174', 'https://tobenot.top', 'https://bwb.tobenot.top', - 'https://tyo.tobenot.top', // 添加你的后端域名 ]; // 从环境变量添加额外的CORS域名