let ticket = '';
if (location.search.includes('ticket')) {
    ticket = location.search.substring(8);
    const requestURL = 'https://tyyxopenapi.txhlwxx.com/openapi/oauth/zlb/checkticket.php';
    $.ajax({
        url: requestURL,
        async: false,
        type: "POST",
        timeout: 30000,
        dataType: 'json',
        data: {
            type:'login',
            ticket: ticket
        },
        success: (res) => {
            if (res.code == '1') {
                localStorage.setItem('userInfo', JSON.stringify(res.data));
                setTimeout(() => {
                    location.href = './index.html';
                }, 500)
            } else {
                window.alert(res.msg);
            }
        }
    });
}