Example #1
0
        protected override JsonResult <Result <int> > ChangePassowrdByCertificate(string certificate, string password)
        {
            if (string.IsNullOrWhiteSpace(password))
            {
                return(Json(ErrorResult <int>("密码不能为空")));
            }

            certificate = SecureHelper.AESDecrypt(certificate, _encryptKey);
            long userId = long.TryParse(certificate.Split(':')[0], out userId) ? userId : 0;

            if (userId == 0)
            {
                throw new HimallException("数据异常");
            }

            MemberApplication.ChangePassword(userId, password);
            return(JsonResult <int>(msg: "密码修改成功"));
        }