我使用 Quasar 和 Firebase
我收到 FirebaseError:权限缺失或不足。控制台上出现错误
脚本:
// 从 firebase 获取
const 路径 = "/newpage";
this.$auth.onAuthStateChanged(authUser => {
如果(authUser){
this.$bind('userz', this.$db.collection('users'));
this.$db.collection('users').doc(authUser.uid).get()
.then(快照=> {
const userData = snapshot.data();
控制台.log(用户数据);
(this.$route.path !== 路径);
this.$router.push(path).catch(err => {});
this.livePaper = false;
})} 别的 {
this.livePaper = true;
console.log('用户已退出');
this.$router.push('/Login').catch(err => {});
}
})
},
每当我把
```this.$bind('userz', this.$db.collection('users'));```
Run Code Online (Sandbox Code Playgroud)
发生缺少权限的情况
但是当我删除绑定时它没有错误
虽然我想获取用户名:字段中的值并将其放在我的导航上
``` <li v-for="(users, uid) in userz" :key="uid">
{{users.username}} <q-btn v-on:click="livePaper = true" label="Sign Out" @click="logOut()" color="green"/>
Run Code Online (Sandbox Code Playgroud)
````
但我无法得到它,除非我删除
```this.$db.collection('users').doc(authUser.uid).get() …Run Code Online (Sandbox Code Playgroud) permissions firebase quasar google-cloud-firestore quasar-framework