
[英]Web Api Rest returns a Json with data but in Postman don't
[英]Postman returns success, but browser don't
我有一个与v-model
相关的表格。 因此,它是默认登录页面。 当我尝试登录时,我得到了未授权的 401,但在 Postman 中,我得到了具有相同凭据的令牌。
export default {
data() {
return {
email: '',
password: '',
output: ''
};
},
methods: {
login() {
axios.post('api/login', {
email: this.email,
password: this.password },
{ headers: {
'Content-type': 'application/x-www-form-urlencoded',
}
}).then(response => {
this.output = response.data;
});
}
}
}
这有效
axios.post('api/login/',
{
email: this.email,
password: this.password
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.