提交 b3b3353a 编写于 作者: Q qiang

build runtime

上级 e717b591
......@@ -444,6 +444,7 @@ const protocols = { // 需要做转换的 API 列表
request: {
name: my.canIUse('request') ? 'request' : 'httpRequest',
args (fromArgs) {
const method = fromArgs.method || 'GET';
if (!fromArgs.header) { // 默认增加 header 参数,方便格式化 content-type
fromArgs.header = {};
}
......@@ -461,8 +462,8 @@ const protocols = { // 需要做转换的 API 列表
}
},
data (data) {
// 钉钉在content-type为application/json时,不会自动序列化
if (my.dd && headers['content-type'].indexOf('application/json') === 0) {
// 钉钉小程序在content-type为application/json时需上传字符串形式data,使用my.dd在真机运行钉钉小程序时不能正确判断
if (my.canIUse('saveFileToDingTalk') && method.toUpperCase() === 'POST' && headers['content-type'].indexOf('application/json') === 0 && isPlainObject(data)) {
return {
name: 'data',
value: JSON.stringify(data)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册