Pass parameters of post request header application/x-www-form-urlencoded

The post request header application/x-www-form-urlencoded request encountered in development (URLSearchParams to parse)

Insert picture description here

defined in api

Insert picture description here

Add a new URLSearchParams to the required pass parameter append, and you can get the data

Insert picture description here

  let param = new URLSearchParams();
         param.append("merchantId", merchantId);
         param.append("no", no);
        let data = await apiOrder(param)
         if(data.code==200){
          this.$toast.success('确认订单开机成功')
        }else{
          this.$toast.fail('开机失败')
        }

Little dry goods, if you are helpful, please like and pay attention

Guess you like

Origin blog.csdn.net/weixin_45575933/article/details/109362862