提交 d60e90a9 编写于 作者: Q qiang

fix: 解决 H5 端 GET 请求之前出现 OPTIONS 预检请求的问题

上级 8047c7f6
......@@ -79,7 +79,7 @@ export const request = {
validator (value, params) {
const header = params.header = value || {}
if (params.method !== method.GET) {
if (Object.keys(header).filter(key => key.toLowerCase() === 'content-type')) {
if (!Object.keys(header).find(key => key.toLowerCase() === 'content-type')) {
header['Content-Type'] = 'application/json'
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册