close-account.js 371 B

12345678910111213141516
  1. const {
  2. setUserStatus
  3. } = require('../../lib/utils/update-user-info')
  4. const {
  5. USER_STATUS
  6. } = require('../../common/constants')
  7. /**
  8. * 注销账户
  9. * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#close-account
  10. * @returns
  11. */
  12. module.exports = async function () {
  13. const { uid } = this.authInfo
  14. return setUserStatus(uid, USER_STATUS.CLOSED)
  15. }