ZaiZai 6 ヶ月 前
コミット
11a8f989b4
2 ファイル変更5 行追加4 行削除
  1. 1 1
      public/version.json
  2. 4 3
      vite.config.js

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240820180047"
+  "value": "20240821140053"
 }

+ 4 - 3
vite.config.js

@@ -62,9 +62,10 @@ export default defineConfig({
                 rewrite: (path) => path.replace(new RegExp('^/api'), '/'),
                 // 排除特定文件名
                 bypass: (req) => {
-                    const excludedFiles = ['humidity.js']
-                    const requestFile = req.url.split('/').pop()
-                    return excludedFiles.includes(requestFile) ? req.url : null
+                    if (req.originalUrl.endsWith('/humidity.js')) {
+                        return req.originalUrl
+                    }
+                    return null
                 },
             },
             '/yunApi': {