【问题标题】:how to send the firebase token at the django backend with vue?如何使用 vue 在 django 后端发送 firebase 令牌?
【发布时间】: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


【解决方案1】:

你现在可以做,你发送令牌时没有你的密钥

''' axios.post(路径,{'token_id':idToken}) '''

【讨论】:

    猜你喜欢
    • 2021-04-06
    • 2018-04-07
    • 2021-12-26
    • 2020-08-03
    • 1970-01-01
    • 2018-03-27
    • 2019-11-14
    • 1970-01-01
    • 2020-09-16
    相关资源
    最近更新 更多