【发布时间】:2021-06-19 13:17:05
【问题描述】:
我无法将 firebase 令牌发送到后端,我认为问题在于该函数不是异步的,但它仍然对我不起作用,请我需要帮助,谢谢!
user.getIdToken(true)
.then(function(idToken) {
const path = 'http://localhost:8000/api/google-login'
console.log(idToken)
axios.post(path , idToken)
.then((response) => {
console.log('anda o no anda')
})
.catch((error) => {
console.log(error);
});
}).catch(function(error) {
console.log(error)
});
控制台中的错误。 POST http://localhost:8000/api/google-login 500(内部服务器错误) 但如果我复制 idtoken 并将其手动发送到后端,它就可以工作。
【问题讨论】:
-
能否贴出后端的完整日志?
标签: javascript django vue.js