post重定向后变成了get请求

简单记录我在开发中遇到的情况:
错误代码:

// 错误代码
this.$ajax({
  methods: 'post',
  url: this.baseUrl + '/checkQrCode',
  params: {
    openId: this.store.openId,
    qrCode: this.store.qrCode
  }
})
// 错误原因: ‘methods’ 应该改为‘method’

错误提示:
在这里插入图片描述

错误原因:

methods 应该改为method

正确代码:

// 正确代码
this.$ajax({
  method: 'post',
  url: this.baseUrl + '/checkQrCode',
  params: {
    openId: this.store.openId,
    qrCode: this.store.qrCode
  }
})

猜你喜欢

转载自blog.csdn.net/rainbow8300/article/details/87266258