提交 e407364b 编写于 作者: Q qiang

feat: H5 uni.request 支持 withCredentials 参数配置

上级 ea551cdf
...@@ -100,5 +100,8 @@ export const request = { ...@@ -100,5 +100,8 @@ export const request = {
value = (value || '').toLowerCase() value = (value || '').toLowerCase()
params.responseType = Object.values(responseType).indexOf(value) < 0 ? responseType.TEXT : value params.responseType = Object.values(responseType).indexOf(value) < 0 ? responseType.TEXT : value
} }
},
withCredentials: {
type: Boolean
} }
} }
...@@ -45,7 +45,8 @@ export function request ({ ...@@ -45,7 +45,8 @@ export function request ({
header, header,
method, method,
dataType, dataType,
responseType responseType,
withCredentials
}, callbackId) { }, callbackId) {
const { const {
invokeCallbackHandler: invoke invokeCallbackHandler: invoke
...@@ -143,6 +144,7 @@ export function request ({ ...@@ -143,6 +144,7 @@ export function request ({
errMsg: 'request:fail' errMsg: 'request:fail'
}) })
} }
xhr.withCredentials = withCredentials
xhr.send(body) xhr.send(body)
return requestTask return requestTask
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册