哎呀。电子邮件地址格式错误 Firebase / Vue

我收到错误消息“糟糕。电子邮件地址格式错误。” 甚至当我什至不填写任何内容时。


我已经尝试在不同的地方导入 Firebase,但它没有解决问题。


<script>

import firebase from "firebase";


export default {

  name: "login",

  data() {

    return {

      email: "",

      password: ""

    };

  },

  methods: {

    login: function() {

      firebase

        .auth()

        .signInWithEmailAndPassword(this.email, this.password)

        .then(

          function(user = user) {

            alert("Well done! You are now logged in");

          },

          function(err) {

            alert("Oops. " + err.message);

          }

        );

    }

  }

};

</script>


DIEA
浏览 137回答 2
2回答

炎炎设计

如果电子邮件 ID 是否带有 qoutes,您可以您可以在检查网络中检查

jeck猫

使用以下代码修复它:&nbsp; &nbsp; <script>&nbsp; import firebase from 'firebase';&nbsp; export default {&nbsp; &nbsp; name: 'login',&nbsp; &nbsp; data() {&nbsp; &nbsp; &nbsp; return {&nbsp; &nbsp; &nbsp; &nbsp; email: '',&nbsp; &nbsp; &nbsp; &nbsp; password: ''&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; },&nbsp; &nbsp; methods: {&nbsp; &nbsp; &nbsp; login: function() {&nbsp; &nbsp; &nbsp; &nbsp; firebase.auth().signInWithEmailAndPassword(this.email, this.password).then(&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (user) => {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.$router.replace('home')&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (err) => {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alert('Oops. ' + err.message)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; );&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }&nbsp; }</script>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript