fix: 放宽 CORS origin 配置为允许所有来源以支持小程序环境
This commit is contained in:
+1
-5
@@ -42,11 +42,7 @@ app.use(helmet({
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
origin: [
|
origin: true,
|
||||||
'https://servicewechat.com',
|
|
||||||
'https://miniapp-api-test.dxz99wyr.cn',
|
|
||||||
'https://api-miniapp.dxz99wyr.cn'
|
|
||||||
],
|
|
||||||
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
|
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
|
||||||
allowedHeaders: ['Content-Type', 'Authorization', 'Accept', 'Origin', 'X-Requested-With'],
|
allowedHeaders: ['Content-Type', 'Authorization', 'Accept', 'Origin', 'X-Requested-With'],
|
||||||
credentials: false
|
credentials: false
|
||||||
|
|||||||
Reference in New Issue
Block a user