close-account.js 387 字节
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
const {
  setUserStatus
} = require('../../lib/utils/update-user-info')
const {
  USER_STATUS
} = require('../../common/constants')

/**
 * 注销账户
 * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#close-account
 * @returns
 */
module.exports = async function () {
  const { uid } = this.authInfo
  return setUserStatus(uid, USER_STATUS.CLOSED)
}