为什么这不起作用又不行:
async login ({ dispatch, state }, user) {
const token = await this.$fireAuth.currentUser.getIdToken(true)
const userInfo = user
Cookies.set('access_token', token) // saving token in cookie for server rendering
await dispatch('setUSER', userInfo)
await dispatch('saveUID', userInfo.uid)
},
但这可以正常工作:
async login ({ dispatch, state }, user) {
const token = await this.$fireAuth.currentUser.getIdToken(true)
const userInfo = {
displayName: "Nicl",
email: user.email,
avatar: user.photoURL,
uid: user.uid,
emailVerified: user.emailVerified
}
Cookies.set('access_token', token) // saving token in cookie for server rendering
await dispatch('setUSER', userInfo)
await dispatch('saveUID', userInfo.uid)
},
我不明白为什么我会得到我觉得是随机的错误?