
自定义脚本
function setParam() {
try {
// 1. 获取临时变量中的order_id
const order_bind_id = pm.variables.get(“order_bind_id”);
console.log(order_bind_id)
let goodsJsonArr = [
{
goods_id: -1,
goods_num: 1,
goods_sale_price: 300,
order_band_id: order_bind_id,
continue_min: 30,
goods_type: -1
}
]
pm.variables.set(“goods_json”, JSON.stringify(goodsJsonArr));
} catch (error) {
// 捕获异常并打印错误信息
console.error(“失败:”, error.message);
}
}
// 执行函数完成参数设置
setParam();
