在URL中传递带有特殊符号的用户名和密码

时间:2019-03-11 06:45:38

标签: jquery

当我使用 encodeURIComponent 时,我得到的密码不正确,而当我在密码中使用#或任何其他符号时,我无法登录。对于没有符号的密码,我可以轻松登录。任何解决方案都可以使我能够在url中使用特殊字符,而又不会破坏我的代码的正常流程。

$("#btnLogin").click(function () {
    ValidateLoginForm() && ($("#btnLogin").addClass("myprogress"), $.post("http://tester.icaresoftware.com/Service%20References/LoginService.asmx/Login", {
        UserEmail: $("#userEmailAddress").val(),
        Password: $("#userPassword").val()
    }, function (e) {
        debugger;
        var uri = encodeURIComponent("http://tester.icaresoftware.com/Gateway/Gateway/RedirectFromWeb?UserEmail=" + $("#userEmailAddress").val() + "&Password=" + $("#userPassword").val() );
        $("#btnLogin").removeClass("myprogress"), "Success" == $($(e)[0]).text() ? location.href = uri: $(".msg-area").html("<span>The email address or password you entered is incorrect.</span>")
    }))

0 个答案:

没有答案