【发布时间】:2018-12-23 02:43:42
【问题描述】:
我正在通过POST 请求注册用户。
为此,我将 axios 与 async/await 一起使用!但是,我收到register.then is not a function 错误。请帮帮我。
async sendUserData() {
try {
const register = await axios.post('/register', {
email: this.register.email.trim(),
password: this.register.password.trim(),
});
register.then(
response => {
console.log(response);
}
);
} catch (e) {
console.log(e);
}
}
【问题讨论】:
标签: javascript asynchronous vue.js axios ecmascript-2016