建立 devServer.js 文件 配置以下内容
module.exports = () => ({
https: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
},
// proxy: {
// '/mock/kq7t3ijo': {
// target: 'https://11.122.36.39',
// pathRewrite: { '^/mock/kq7t3ijo': '' },
// changeOrigin: true,
// },
// },
});