Example #1
0
 /// <inheritdoc />
 /// <summary>
 /// 移除用户
 /// </summary>
 /// <returns></returns>
 public Status DeleteUser()
 {
     if (AppUser == null)
     {
         return(Status.TokenExpired);
     }
     _db.Delete(AppUser);
     return(Status.Ok);
 }
Example #2
0
        public void DeleteUser(string email)
        {
            var user = _userDbContext.FindByEmail(email);

            if (user != null)
            {
                _userDbContext.Delete(user.Id);
            }
        }
Example #3
0
        /// <inheritdoc />
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        public Status DeleteUser(string uid)
        {
            if (IsNullOrWhiteSpace(uid))
            {
                return(Status.InputIllegal);
            }
            var user = _db.Find(uid);

            if (user == null)
            {
                return(Status.UidNotFind);
            }
            if (user.IsMaster())
            {
                return(Status.NotAllowed);
            }
            _db.Delete(user);
            return(Status.Ok);
        }