From 403b7dfacfcbd3313caaaa60ae9ccf99f4cfc942 Mon Sep 17 00:00:00 2001 From: along <1015042407@qq.com> Date: Wed, 1 Apr 2026 14:32:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend-deploy/docker-compose.yml | 2 +- frontend-deploy/nginx.conf | 4 ++-- frontend/vite.config.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend-deploy/docker-compose.yml b/frontend-deploy/docker-compose.yml index 41be649..33d94ae 100644 --- a/frontend-deploy/docker-compose.yml +++ b/frontend-deploy/docker-compose.yml @@ -7,5 +7,5 @@ services: - "80:80" volumes: - ../dist:/usr/share/nginx/html:ro - - ../data:/usr/share/nginx/data:ro + - ../fiction:/usr/share/nginx/fiction:ro - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro \ No newline at end of file diff --git a/frontend-deploy/nginx.conf b/frontend-deploy/nginx.conf index 4c62f9d..2211ca0 100644 --- a/frontend-deploy/nginx.conf +++ b/frontend-deploy/nginx.conf @@ -9,8 +9,8 @@ server { location / { try_files $uri $uri/ /index.html; } - location /data/ { - alias /usr/share/nginx/data/; + location /novel-data/ { + alias /usr/share/nginx/fiction/; charset utf-8; } location /assets/ { diff --git a/frontend/vite.config.js b/frontend/vite.config.js index b9e4f71..143103c 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -15,7 +15,7 @@ export default defineConfig({ configureServer(server) { server.middlewares.use('/novel-data', (req, res, next) => { // req.url 会像 /dtslz/data/vol01.json - const filePath = path.resolve(__dirname, '..', req.url.replace(/^\//, '').split('?')[0]) + const filePath = path.resolve(__dirname, '../fiction', req.url.replace(/^\//, '').split('?')[0]) try { const content = fs.readFileSync(filePath, 'utf-8') res.setHeader('Content-Type', 'application/json; charset=utf-8')