小栗
小栗
  • 发布:2025-05-15 16:34
  • 更新:2025-05-15 16:39
  • 阅读:34

【报Bug】uni.request data在鸿蒙app的传参问题

分类:鸿蒙Next

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win11

HBuilderX类型: 正式

HBuilderX版本号: 4.65

手机系统: HarmonyOS NEXT

手机系统版本号: HarmonyOS NEXT Developer Preview

手机厂商: 华为

手机机型: 华为 mate 60

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

this.$api.post(this.global.apiUrls.orderConfirm2024, {
data: this.form.data, // 数组
address_id: this.form.address_id,
coupon_id: this.form.coupon_id,
service_time: this.form.service_time,
worker_id: this.form.worker_id,
type: this.form.type,
pay_type: this.isBalance ? 'balance' : this.payType,
vip_id: this.VipComboIndex != -1 ? this.VipList[this.VipComboIndex].id : ''
}, {
header: {
'Content-Type': 'application/json; charset=utf-8'
}
})

操作步骤:

// 4.61 版本没问题, 4.65版本这次传参不行了
uni.request({
url:"",
data:{
list:[{data:1}], // 后台参数报错, h5取参数正常,鸿蒙报错
a:"1", // h5和鸿蒙都正常
}
})

预期结果:

和h5保持一致逻辑

实际结果:

h5正常,鸿蒙参数不对

bug描述:

同样的代码,在鸿蒙app后台取不到传的data字段数据( this.form.data),在浏览器可以,后台取不到 data的数据

2025-05-15 16:34 负责人:无 分享
已邀请:
小栗

小栗 (作者) - 嘻嘻

我恢复到4.64版本正常,4.65版本后台取参会有问题

要回复问题请先登录注册