|
|
@@ -17,7 +17,7 @@ const proxyTable = config.proxyTable
|
|
|
if (proxyTable) {
|
|
|
// 本地代理支持localhost、127.0.0.1等不同地址跨域
|
|
|
app.use((req, res, next) => {
|
|
|
- res.header('Access-Control-Allow-Origin', `${req.protocol}://${req.headers.host}`)
|
|
|
+ res.header('Access-Control-Allow-Origin', req.get('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')
|