Angularjs 返回许多重定向的函数

Angularjs function returning to many redirects

我是 AngularJS 的新手,我有一个函数返回“尝试了太多自动重定向。我是 运行 Ionic 和 AngularJS 在应用程序端和在服务器端我是 运行 C#。我没有创建 C# 服务器端,所以我不知道从哪里开始寻找错误。我的问题是我应该寻找特定的东西吗?什么会导致显示此错误?这是在服务器端还是在客户端?

var forgotPassword = ForgotPassword.save({email:resp}).$promise.then(
        function Success(sucresp) {
          console.log("This returned with: " + sucresp)
          if (sucresp.ForgotPasswordResult.IsSuccess == true) {
              $ionicPopup.alert({
                    title: "Password Changed",
                    template: sucresp.ForgotPasswordResult.ErrorMessage
                });
          } else {
              $ionicPopup.alert({
                    title: "Password Was Not Changed",
                    template: sucresp.ForgotPasswordResult.ErrorMessage
                });
          }
        },
        function Failed(erresp){

          console.log("This failed like your life, now start crying: " + erresp)
          $ionicPopup.alert({
                    title: "Error Messge",
                    template: erresp
                });
        }
      ); 

服务器端是。

public ForgotPasswordResponse ForgotPassword(string email)
    {
        ForgotPasswordResponse resp = new ForgotPasswordResponse();
        resp.IsSuccess = false;

        string emailAddress = email;

        System.Security.Cryptography.RandomNumberGenerator randGen = System.Security.Cryptography.RandomNumberGenerator.Create();
        byte[] bytes = new byte[6];
        randGen.GetNonZeroBytes(bytes);
        string newPassword = Convert.ToBase64String(bytes);
        newPassword = Regex.Replace(newPassword, "[^a-zA-Z0-9]+", "", RegexOptions.Compiled);

        bool resetPasswordResult = false;
        try
        {
            string emailBody = string.Format(@"Your ****.com password has been reset.

The new password is {0}

Go to https://****.com/Login/login.aspx to login to the web site.

It is recommended that you change your password as soon as possible.

This message was sent from an automated system.  Please do not reply to it.", newPassword);

            Email.SendAmazonSES(emailAddress, "password reset", emailBody);
            resetPasswordResult = ResetPassword(emailAddress, newPassword);

            if (resetPasswordResult == false)
            {
                throw new Exception("The user account does not exist.");
            }

            resp.IsSuccess = true;
            resp.ErrorMessage = "Your password has been reset.  Check your email for the new password.";
        }
        catch (Exception ex)
        {
            resp.IsSuccess = false;
            resp.ErrorMessage = ex.Message;
            return resp;
        }

        return resp;
    }

这样做的原因是一页从一页转到另一页然后回到第一页。它正在将它从一个页面重定向到另一个页面并最终超时。