fix:手动构建form-urlencoded body确保wave_task_id不被uni.request序列化吞掉
This commit is contained in:
parent
9cec1f3d42
commit
d4e88405d5
@ -2539,6 +2539,14 @@ export default {
|
|||||||
var sign = calculateSign(params)
|
var sign = calculateSign(params)
|
||||||
params.sign = sign
|
params.sign = sign
|
||||||
|
|
||||||
|
// 手动构建 form-urlencoded 字符串,确保 bracket 键名原样发送
|
||||||
|
var bodyParts = []
|
||||||
|
for (var key in params) {
|
||||||
|
bodyParts.push(encodeURIComponent(key) + '=' + encodeURIComponent(String(params[key])))
|
||||||
|
}
|
||||||
|
var formBody = bodyParts.join('&')
|
||||||
|
console.log('【提交入库】form-body:', formBody)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await new Promise(function (resolve, reject) {
|
const res = await new Promise(function (resolve, reject) {
|
||||||
uni.request({
|
uni.request({
|
||||||
@ -2548,7 +2556,7 @@ export default {
|
|||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
'Authorization': 'Bearer ' + token
|
'Authorization': 'Bearer ' + token
|
||||||
},
|
},
|
||||||
data: params,
|
data: formBody,
|
||||||
success: function (r) { resolve(r) },
|
success: function (r) { resolve(r) },
|
||||||
fail: function (e) { reject(e) }
|
fail: function (e) { reject(e) }
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user