Răsfoiți Sursa

fix: 允许 color2.jccytech.cn 访问 Vite 预览 dev server

- 在 templates/coloring/vite.config.js 中添加 server.allowedHosts
- nginx 代理请求时 Host header 为 color2.jccytech.cn,Vite 默认拒绝
guoziyun 3 săptămâni în urmă
părinte
comite
0608788002
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      templates/coloring/vite.config.js

+ 3 - 0
templates/coloring/vite.config.js

@@ -44,6 +44,9 @@ module.exports = defineConfig(({ mode }) => {
 
   return {
     plugins: [viteSingleFile(), finalizeHtmlPlugin(outDir, adapter)],
+    server: {
+      allowedHosts: ["color2.jccytech.cn", "localhost", ".jccytech.cn"],
+    },
     resolve: {
       alias: {
         "#ad-config": path.resolve(