<commit_before>$(function () {
    if (!sg.common.is_weixin()) {
        alert("送礼功能目前只支持微信哦~");
        window.location.href = "/";
    }

    var receive = sg.common.param("receive", 0);
    if (receive == 1 && sg.common.is_login()) sg.receive.receive();

    $("#btn_receive").on("click", function () {
        if (!sg.common.is_login()) {
            alert("本新年礼包只有松果亲子的注册用户才能领取哦，您还没有登录，快去登录后再来领取吧~（未注册的用户需要先注册）");
            var current_url = window.location.href + "&receive=1";
            window.location.href = "/auth/login?ref=" + encodeURIComponent(current_url);
        } else {
            sg.receive.receive();
        }
    });
});

sg.receive = {
    receive: function () {
        var oid = sg.common.param("oid");
        var expired = sg.common.param("expired");
        var giftsign = sg.common.param("giftsign");
        sg.common.post(sg.config.api + "/subject/order/gift/receive", {
            utoken: sg.common.cookie.get("utoken"),
            oid: oid,
            expired: expired,
            giftsign: giftsign
        }, function (data) {
            if (data == true) {
                alert("新年礼物领取成功，快去选课吧~");
                window.location.href = "/user/bookable";
            } else {
                alert("新年礼物领取失败，请与客服联系");
            }
        });
    }
};<commit_msg>礼物->礼包<commit_after>$(function () {
    if (!sg.common.is_weixin()) {
        alert("送礼功能目前只支持微信哦~");
        window.location.href = "/";
    }

    var receive = sg.common.param("receive", 0);
    if (receive == 1 && sg.common.is_login()) sg.receive.receive();

    $("#btn_receive").on("click", function () {
        if (!sg.common.is_login()) {
            alert("本新年礼包只有松果亲子的注册用户才能领取哦，您还没有登录，快去登录后再来领取吧~（未注册的用户需要先注册）");
            var current_url = window.location.href + "&receive=1";
            window.location.href = "/auth/login?ref=" + encodeURIComponent(current_url);
        } else {
            sg.receive.receive();
        }
    });
});

sg.receive = {
    receive: function () {
        var oid = sg.common.param("oid");
        var expired = sg.common.param("expired");
        var giftsign = sg.common.param("giftsign");
        sg.common.post(sg.config.api + "/subject/order/gift/receive", {
            utoken: sg.common.cookie.get("utoken"),
            oid: oid,
            expired: expired,
            giftsign: giftsign
        }, function (data) {
            if (data == true) {
                alert("新年礼包领取成功，快去选课吧~");
                window.location.href = "/user/bookable";
            } else {
                alert("新年礼包领取失败，请与客服联系");
            }
        });
    }
};
{'fraction_non_alphanumeric': 0.16978967495219885, 'fraction_numerical': 0.002294455066921606, 'mean_word_length': 1.9196428571428572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2722544', 'n_tokens_mistral': 973, 'n_tokens_neox': 991, 'n_words': 120}