登录注册体系的源码级硬切换

This commit is contained in:
2026-08-23 20:30:01 +08:00
parent 73fcd4ed72
commit af52f9e94d
72 changed files with 1666 additions and 6576 deletions
-111
View File
@@ -2460,9 +2460,6 @@ function z_auto_fun() {
container: 'body',
});
//登录注册
$('.signsubmit-loader').length && tbquire(['sign-register']);
//复制内容
$('[data-clipboard-text]').length && tbquire(['clipboard']);
@@ -3025,114 +3022,6 @@ _win.bd.on('click', '[ajax-action]', function () {
});
});
//登录注册
_win.bd.on('click', '.signin-loader', function () {
if (_win.sign_type == 'page') {
window.location.href = _win.signin_url;
window.location.reload;
} else {
$('.modal:not(#u_sign)').modal('hide');
$('#u_sign').modal('show');
if (_win.signin_wx_priority) {
$('a[href="#tab-qrcode-signin"]').tab('show');
$('.social-login-item.weixingzh:first').click();
} else {
$('a[href="#tab-sign-in"]').tab('show');
}
}
});
_win.bd.on('click', '.signup-loader', function () {
if (_win.sign_type == 'page') {
window.location.href = _win.signup_url;
window.location.reload;
} else {
$('.modal:not(#u_sign)').modal('hide');
$('#u_sign').modal('show');
$('a[href="#tab-sign-up"]').tab('show');
}
});
//扫码登录、绑定
_win.bd.on('click', '.qrcode-signin', function () {
$('.modal:not(#u_sign)').modal('hide');
$('#u_sign').modal('show');
$('a[href="#tab-qrcode-signin"]').tab('show');
var _this = $(this);
var url = _this.attr('href');
var container = $('.qrcode-signin-container');
if (container.find('[get-only-one]').length) {
container.find('[name="code"]').val('').trigger('change');
return !1;
}
container.html('<p class="placeholder" style="height:180px;width:180px;margin:auto;"></p><p class="placeholder" style="height:27px;width:200px;margin:15px auto 0;"></p>');
$.post(
url,
null,
function (n) {
n || notyf(aksrt__('qrcode_failed'), 'danger');
var ys = n.ys ? n.ys : n.error ? 'danger' : '';
n.msg && notyf(n.msg, ys);
if (n && n.html) {
container.html(n.html);
_win.qrcode_signin = {
url: n.url,
state: n.state,
};
checkLogin();
}
},
'json'
);
return !1;
});
function checkLogin() {
if (_win.checkLoginTimer) return;
//循环执行调整到ajax外部,避免移动端截图扫码,停止查询登录
// 2秒后再次查询
_win.checkLoginTimer = setInterval(checkLoginAjax, 2000);
}
function checkLoginAjax() {
var url = _win.qrcode_signin.url;
var state = _win.qrcode_signin.state;
if (!url || !state) {
clearInterval(_win.checkLoginTimer);
_win.checkLoginTimer = false;
return;
}
$.post(
url,
{
state: state,
oauth_rurl: window.location.href,
action: 'check_callback',
},
function (n) {
//做逻辑判断,登录跳转
if (n && n.goto) {
window.location.href = n.goto;
window.location.reload;
}
},
'json'
);
}
//模态框关闭停止查询登录
_win.bd.on('hide.bs.modal', '.modal#u_sign', function () {
_win.qrcode_signin = {
url: false,
state: false,
};
});
//防抖函数
function throttle(fn, delay) {
let valid = true;