cors允许DELETE方法

This commit is contained in:
2024-09-01 13:44:46 +08:00
parent f48395dda1
commit 8755df31c9

View File

@@ -12,7 +12,7 @@ class APILoader {
this.app.use(express.urlencoded({ extended: true })); this.app.use(express.urlencoded({ extended: true }));
this.app.use(cors({ this.app.use(cors({
origin: ['http://localhost:5173', 'http://note.ctbu.net.cn', 'http://124.223.5.195:23501'], origin: ['http://localhost:5173', 'http://note.ctbu.net.cn', 'http://124.223.5.195:23501'],
methods: ['GET', 'POST'], methods: ['GET', 'POST', 'DELETE'],
allowedHeaders: ['Content-Type', 'Authorization', 'Access-Control-Allow-Origin', ''], allowedHeaders: ['Content-Type', 'Authorization', 'Access-Control-Allow-Origin', ''],
})); }));
} }