Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to sign off immediately after sign in #17

Open
lianyi opened this issue Sep 22, 2019 · 1 comment
Open

unable to sign off immediately after sign in #17

lianyi opened this issue Sep 22, 2019 · 1 comment

Comments

@lianyi
Copy link

lianyi commented Sep 22, 2019

登陆之后无法直接点“退出登陆”来退出。 具体error如下

VM628 WAService.js:1 Uncaught (in promise) Error: errCode: -1  | errMsg: collection.doc:fail docId must not be empty; at collection.doc api; 
    at new u (VM628 WAService.js:1)
    at d (VM628 WAService.js:1)
    at Object.t.returnAsFinalCloudSDKError (VM628 WAService.js:1)
    at s.doc (VM628 WAService.js:1)
    at l._callee7$ (index.js? [sm]:193)
    at tryCatch (runtime.js? [sm]:66)
    at Generator.invoke [as _invoke] (runtime.js? [sm]:292)
    at Generator.prototype.<computed> [as next] (runtime.js? [sm]:118)
    at step (index.js:3)
    at index.js:3

看起来是因为userinfo中的_id 并不存在。 但是重新打开这个页面就可以了

@lianyi
Copy link
Author

lianyi commented Sep 22, 2019

对应的代码是/pages/user/index.js 中

// 退出登录
  async bindLogout() {
    const userInfo = this.data.userInfo

    await this.db.collection('users').doc(userInfo._id).update({
      data: {
        expireTime: 0
      }
    })

    this.setUserInfo()
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant