Browse Source

fix: cors multiple

ryanemax 3 months ago
parent
commit
0efef0a7a8
1 changed files with 8 additions and 8 deletions
  1. 8 8
      rag-server/api/psql/routes.js

+ 8 - 8
rag-server/api/psql/routes.js

@@ -7,14 +7,14 @@ router.use(bodyParser.urlencoded({
 router.use(bodyParser.json({ limit: '10mb' }));
 
 // 跨域参数配置
-const allowCrossDomain = function (req, res, next) {
-    res.header('Access-Control-Allow-Origin', '*');
-    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
-    res.header('Access-Control-Allow-Headers', 'Content-Type');
-    res.header('Access-Control-Allow-Credentials', 'true');
-    next();
-};
-router.use(allowCrossDomain)
+// const allowCrossDomain = function (req, res, next) {
+//     res.header('Access-Control-Allow-Origin', '*');
+//     res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
+//     res.header('Access-Control-Allow-Headers', 'Content-Type');
+//     res.header('Access-Control-Allow-Credentials', 'true');
+//     next();
+// };
+// router.use(allowCrossDomain)
 
 function goWrong(response,msg){
     response.status(500)