Administrator
2024-07-29 a053811c774ac07340e46561f5d2ab4d892282a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var http_util = {
    post: function(url, params, success_callback, fail_callback) {
        $.post(url, params, function(response) {
            if (response.code == 1001) {
                window.location.replace("login.html?redirect="+encodeURIComponent(window.location.href));
            } else {
                success_callback(response);
            }
        }, 'json').fail(function(jqXHR, textStatus, errorThrown) {
            fail_callback("网络请求失败");
        });
    },
    getQueryString:function(name) {
        console.log(window.location.search)
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
            return unescape(decodeURI(r[2]));
        return null;
    }
};