JSon传入字符串加密escape+C#后台Server.UrlDecode解密

var article = GetArticle();
            var and = escape($.toJSON($('#content').val()))
            $.ajax({
                type: "POST",
                contentType: "application/json;utf-8",
                url: "/Front/SaveNewPassage",
                data: '{json:"' + and + '"}',
                dataType: "",
                success: function (data, textStatus) {
                    if (data === "success") {
                        alert("保存成功!");
                        $('#content').val('');
                        setInterval(displaymessage, 3000);
                    }
                    else{
                        alert("保存失败!");
                    }
                },
                complete: function (XMLHttpRequest, textStatus) {
                    //HideLoading();
                },
                error: function (statusText, responseText) {
                    //请求出错处理
                    alert(statusText.responseText);
                }
            });

通过escape加密数据,在C#后台中 string newPassage = Server.UrlDecode(and);解密

转载于:https://my.oschina.net/ZoeyZhong/blog/1836934

你可能感兴趣的:(JSon传入字符串加密escape+C#后台Server.UrlDecode解密)