通过this.$http()配置参数为method: 'POST'去请求,需要传参为json字符串,通过JSON.stringify()请求参数在控制台看始终是一个对象,配置‘headers’无效。
改成this.$http.post,配置‘headers’:'Content-Type': 'application/json'
问题解决。
通过this.$http()配置参数为method: 'POST'去请求,需要传参为json字符串,通过JSON.stringify()请求参数在控制台看始终是一个对象,配置‘headers’无效。
改成this.$http.post,配置‘headers’:'Content-Type': 'application/json'
问题解决。