Javascript Firebase身份验证:错误消息赢得';当用户密码/电子邮件不正确时不会出现。快速修复?
我正在尝试编写一个弹出提示“密码不正确”的代码,但我已经尝试了几次,但都不起作用。控制台本身显示错误消息:Uncaught(in promise)t{code:“auth/error password”,消息:“密码无效或用户没有密码。”,a:null}Javascript Firebase身份验证:错误消息赢得';当用户密码/电子邮件不正确时不会出现。快速修复?,javascript,firebase,firebase-authentication,vuetify.js,Javascript,Firebase,Firebase Authentication,Vuetify.js,我正在尝试编写一个弹出提示“密码不正确”的代码,但我已经尝试了几次,但都不起作用。控制台本身显示错误消息:Uncaught(in promise)t{code:“auth/error password”,消息:“密码无效或用户没有密码。”,a:null} <template> <v-row justify="center"> <v-col md="4"> <v-car
<template>
<v-row justify="center">
<v-col md="4">
<v-card elevation="2">
<v-card-title>Login</v-card-title>
<v-card-text>
<v-form
ref="form"
v-model="valid"
lazy-validation
>
<v-text-field
v-model="email"
:rules="emailRules"
label="Email"
outlined
required
>
</v-text-field>
<v-text-field
v-model="password"
:rules="passwordRules"
label="Password"
outlined
required
:type="show ? 'text' : 'password'"
@click:append="show = !show"
:append-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
>
</v-text-field>
<v-btn
elevation="2"
color="primary"
@click="login"
>
Login
</v-btn>
</v-form>
<p class="pt-2">Create an account? <router-link :to="{ name: 'Register' }">Register</router-link></p>
</v-card-text>
</v-card>
</v-col>
</v-row>
</template>
<script>
export default {
data() {
return {
show: false,
valid: false,
email: '',
password: '',
emailRules: [
v => !!v || 'Email is required',
v => /.+@.+/.test(v) || 'Email must be valid'
],
passwordRules: [
v => !!v || 'Password is required',
v => v.length >= 8 || 'Password must be 8 characters or more'
]
}
},
methods: {
login() {
const valid = this.$refs.form.validate()
if(valid){
this.$store.dispatch('login', {
email: this.email,
password: this.password
})
}
}
}
}
</script>
登录
登录
是否创建帐户?登记册
导出默认值{
数据(){
返回{
秀:假,,
有效:假,
电子邮件:“”,
密码:“”,
电子邮件规则:[
v=>!!v | |“需要电子邮件”,
v=>/.+@.+/.test(v)| |“电子邮件必须有效”
],
密码规则:[
v=>!!v | |“需要密码”,
v=>v.length>=8 | |“密码必须为8个或更多字符”
]
}
},
方法:{
登录(){
const valid=this.$refs.form.validate()
如果(有效){
此.$store.dispatch('login'{
电子邮件:this.email,
密码:这个是密码
})
}
}
}
}
上面是我的登录页面,有人能帮我吗?干杯:)您包含的代码没有显示错误的抛出位置,您可以在此处使用EmailandPassword()调用
Signin。我们需要这样才能有所帮助。