标签后的 inline script 中,此处保留函数供其他地方调用) // 显示loading(统一使用单一容器ID;并存模式用 combined 遮罩) function showWecomLoading(containerId) { var $mask = (containerId === 'banner-scan-qrcode-container' && $('#wecom-loading-mask-combined').length) ? $('#wecom-loading-mask-combined') : $('#wecom-loading-mask'); $mask.css({ opacity: 1, visibility: 'visible' }); } // 隐藏loading function hideWecomLoading(containerId) { var $mask = (containerId === 'banner-scan-qrcode-container' && $('#wecom-loading-mask-combined').length) ? $('#wecom-loading-mask-combined') : $('#wecom-loading-mask'); $mask.css({ opacity: 0, visibility: 'hidden' }); } // 动态加载企业微信SDK // showLoading: 是否展示右侧/底部 loading 动画(初始加载时可关闭,只在切换 tab 时开启) function loadWecomSDK(callback, containerId, showLoading) { if (wecomSDKLoaded) { callback && callback(); return; } if (wecomSDKLoading) { var checkInterval = setInterval(function() { if (wecomSDKLoaded) { clearInterval(checkInterval); callback && callback(); } }, 100); return; } wecomSDKLoading = true; if (showLoading) { showWecomLoading(containerId); } var script = document.createElement('script'); // script.src="/__xh__/yjsxt.gzy.edu.cn/node/open/js/wecom-jssdk-2.0.2.js"; script.src='/__xh__/yjsxt.gzy.edu.cn/res/js/login/wecom-jssdk-2.0.2.js;jsessionid=FA6CD7334B5C7AEB47B8BA16B8ECDAB8'; script.onload = function() { wecomSDKLoaded = true; wecomSDKLoading = false; callback && callback(); }; script.onerror = function() { wecomSDKLoading = false; hideWecomLoading(containerId); $('#' + containerId).html('
加载失败,请刷新重试
'); }; document.head.appendChild(script); } // 初始化企业微信登录 // showLoading: 是否展示 loading 动画,默认 true;初始自动加载时可传 false 以避免多余动画 function initWecomLogin(containerId, showLoading) { // 统一使用单一容器ID,根据布局仅会渲染一个实际 DOM if (!containerId) { containerId = 'qywxEwmIddefault'; } if (!wecomSDKLoaded || typeof ww === 'undefined') { loadWecomSDK(function() { initWecomLogin(containerId, showLoading); }, containerId, showLoading !== false); return; } if (showLoading !== false) { showWecomLoading(containerId); } $('#' + containerId).empty(); try { if (isWechatDefaultLogin) { // 构建干净的 redirect_uri:只保留基础路径和有效的 service 参数 var cleanRedirectUri = window.locations.origin + window.locations.pathname; var urlParams = new URLSearchParams(window.locations.search); var serviceParam = urlParams.get('service'); if (serviceParam && serviceParam.trim() !== '') { cleanRedirectUri += '?service=' + encodeURIComponent(serviceParam); } wwLogin = ww.createWWLoginPanel({ el: '#' + containerId, params: { appid: cropId, agentid: agentId, redirect_uri: cleanRedirectUri, state: '0', panel_size: 'small', lang: 'zh', redirect_type: 'callback' }, onLoginSuccess: function(data) { var code = data.code; $.ajax({ url: "/wecomLogin", type: "get", data: { code: code, appid: cropId, state: '0' }, error: function() { $('#login-mima').hide(); $('#login-qrcode-tab').show(); }, success: function(t) { if (t.code === '0') { showModal(t.msg); } else if (t.code === '1') { locations.reload(true); } } }); }, onCheckWeComLogin: function() { hideWecomLoading(containerId); } }); setTimeout(function() { hideWecomLoading(containerId); }, 1500); } else { // 构建干净的 redirect_uri:只保留基础路径和有效的 service 参数 var cleanRedirectUri = window.locations.origin + window.locations.pathname; var urlParams = new URLSearchParams(window.locations.search); var serviceParam = urlParams.get('service'); if (serviceParam && serviceParam.trim() !== '') { cleanRedirectUri += '?service=' + encodeURIComponent(serviceParam); } window.WwLogin({ "id": "qywxEwmId", "appid": cropId, "agentid": agentId, "redirect_uri": encodeURIComponent(cleanRedirectUri), "state": "0", "href": "data:text/css;base64,LmltcG93ZXJCb3gge2hlaWdodDoxMTBweDt9Ci5pbXBvd2VyQm94IC5xcmNvZGUge3dpZHRoOiA5NSU7dmVydGljYWwtYWxpZ246IHRvcDt9Ci5pbXBvd2VyQm94IC50aXRsZSB7ZGlzcGxheTogbm9uZTt9Ci53cnBfY29kZXttYXJnaW4tdG9wOiA2cHghaW1wb3J0YW50O30KLmltcG93ZXJCb3ggLmluZm97ZGlzcGxheTogbm9uZTt9" }); hideWecomLoading(containerId); } } catch (e) { hideWecomLoading(containerId); $('#' + containerId).html('
初始化失败,请刷新重试
'); } } // 销毁企业微信登录(可选传入并存模式下的容器 id,用于清空该容器) function destroyWecomLogin(containerId) { if (wwLogin) { try { if (typeof wwLogin.destroy === 'function') { wwLogin.destroy(); } } catch (e) { } wwLogin = null; } if (containerId && containerId === 'banner-scan-qrcode-container') { $('#banner-scan-qrcode-container').empty(); } else { $('#qywxEwmIddefault').empty(); } } // ========================= // 钉钉扫码登录(独立模块) // ========================= var dingTalkQrInited = false; // ========================= // 易校园扫码登录(独立模块) // ========================= function initDingTalkQr() { initDingTalkQrToContainer('dingtalk-qrcode-container'); dingTalkQrInited = true; } // 向指定容器注入钉钉扫码 iframe(用于 tab 或 banner 并存模式) function initDingTalkQrToContainer(containerId) { var container = document.getElementById(containerId); if (!container) return; if (!dingTalkAppKey) { container.innerHTML = '
钉钉配置缺失,请联系管理员
'; return; } try { // 钉钉 OAuth2 授权(login.dingtalk.com/oauth2/auth);传入 corpId 可免选企业直接进入该企业登录 // 同时透传当前页面上的 service 参数到回调地址,便于回调后继续按原 service 跳转 var params = (typeof getAllUrlParams === 'function') ? getAllUrlParams() : {}; var service = params && params.service ? params.service : ''; // 构建回调地址:只有当 service 存在且不为空时才拼接 service 参数 var redirectUrl = window.locations.origin + '/login/dingtalk-auth-callback'; if (service && service.trim() !== '') { redirectUrl += '?service=' + encodeURIComponent(service); } var src="/__xh__/yjsxt.gzy.edu.cn/oauth2/auth" + '?redirect_uri=' + encodeURIComponent(redirectUrl) + '&response_type=code' + '&client_id=' + encodeURIComponent(dingTalkAppKey) // + '&scope=snsapi_login%20snsapi_phone%20snsapi_email%20openid%20corpid' + '&scope=snsapi_login%20openid%20corpid' + '&state=0' + '&prompt=login,consent' + '&auto_redirect=true' + (dingTalkCorpId ? ('&corpId=' + encodeURIComponent(dingTalkCorpId)) : '') + '&force_login=true' + '&_t=' + new Date().getTime(); var iframe = document.createElement('iframe'); iframe.src = src; iframe.frameBorder = '0'; iframe.allowTransparency = 'true'; iframe.scrolling = 'no'; container.innerHTML = ''; if (!container.style.position) { container.style.position = 'relative'; } // 钉钉二维码专用外层包裹器,直接展示无 loading 动画 var wrapper = document.createElement('div'); wrapper.className = 'dingtalk-qrcode-wrapper dingtalk-qrcode-wrapper--visible'; var innerWrapper = document.createElement('div'); innerWrapper.className = 'dingtalk-qrcode-inner'; innerWrapper.appendChild(iframe); wrapper.appendChild(innerWrapper); container.appendChild(wrapper); iframe.onerror = function () { container.innerHTML = '
钉钉二维码加载失败,请刷新重试
'; }; } catch (e) { container.innerHTML = '
钉钉登录初始化失败,请刷新重试
'; } } // ========================= // 易校园扫码登录(独立模块) // ========================= // 易校园扫码:调用后端 ymQrcodeTokenGenerate 生成 token + 二维码,轮询扫码/确认状态 var yxyScan = { scanIntervalId: -1, sureIntervalId: -1, activeContainerId: '', currentToken: '', getServiceParam: function () { try { var params = (typeof getAllUrlParams === 'function') ? getAllUrlParams() : {}; var service = params && params.service ? params.service : ''; if (!service) { var m = window.locations.href.match(/[?&#]service=([^&]+)/); service = m ? decodeURIComponent(m[1]) : ''; } return service || ''; } catch (e) { return ''; } }, stopAll: function () { if (this.scanIntervalId !== -1) { clearInterval(this.scanIntervalId); this.scanIntervalId = -1; } if (this.sureIntervalId !== -1) { clearInterval(this.sureIntervalId); this.sureIntervalId = -1; } // 停止 ymValidateQrcodeTokenHadScan 轮询 this.stopPollScan(); // 取消后端 token if (this.currentToken) { try { $.post('/ymQrcodeTokenCancel', { date: new Date().getTime() }); } catch (e) {} this.currentToken = ''; } this.activeContainerId = ''; }, stopScanOnly: function () { if (this.scanIntervalId !== -1) { clearInterval(this.scanIntervalId); this.scanIntervalId = -1; } }, setState: function (containerId, msg) { var $msg = $('#' + containerId).find('.yxy-qr-msg'); if (typeof msg === 'string') $msg.text(msg); }, renderContainer: function (containerId) { var container = document.getElementById(containerId); if (!container) return false; container.innerHTML = '' + '
' + '
' + '

' + '
使用易校园扫码

' + '
继续使用统一身份认证
' + '
' + '
' + '
' + ' 未绑定企业微信的用户' + ' ' + ' ' + '
' + '
' + '
' + ''; return true; }, showOverdue: function (containerId, show, msg) { var $box = $('#' + containerId).find('.yixiaoyuan-qr-box'); if (show === false) { $box.find('.yxy-qr-overdue').hide(); } else { if (msg) $box.find('.yxy-qr-overdue span:first').text(msg); $box.find('.yxy-qr-overdue').css('display', 'flex'); } $box.find('.yxy-qr-scaned').hide(); }, showScaned: function (containerId) { var $box = $('#' + containerId).find('.yixiaoyuan-qr-box'); $box.find('.yxy-qr-scaned').css('display', 'flex'); $box.find('.yxy-qr-overdue').hide(); }, // 轮询扫码状态(WAITING -> SCANNED) // 接口:GET /ymValidateQrcodeTokenHadScan // 响应约定(JSON):{ code: '0'=已扫码, '3'=等待中, '1'=过期, '2'=已取消, '4'=已被扫描, '5'=登录成功, msg: '提示信息' } // 轮询持续运行,直到离开易校园 tab(stopAll),不因响应结果而停止 startPollScan: function (containerId) { var that = this; that.stopPollScan(); that._pollScanTimer = setInterval(function () { var ctx = ''; $.ajax({ url: ctx + '/ymValidateQrcodeTokenHadScan', type: 'GET', success: function (res) { var code, msg; if (res && typeof res === 'object') { code = String(res.code).trim(); msg = res.msg || ''; } else { code = $.trim(String(res)); msg = ''; } if (code === '5') { // 登录成功,reload 当前登录页 locations.reload(true); } else if (code === '3') { // 等待中,不处理 } else if (code === '0' || code === '4') { // 已扫码/已被扫描,显示扫码成功遮罩 that.showScaned(containerId); } else { // 其他所有状态(含 code=1 过期、code=2 取消等):显示 msg,展示过期遮罩 that.showOverdue(containerId, true, msg || ''); } // 所有情况均不停止轮询,由 stopAll() 统一终止 }, error: function () { // 网络异常,继续轮询 } }); }, 2000); }, stopPollScan: function () { if (this._pollScanTimer) { clearInterval(this._pollScanTimer); this._pollScanTimer = null; } }, // 轮询确认登录状态(SCANNED -> AUTHORIZED) // TODO: 接口 /ymValidateQrcodeTokenHadSure 就绪后替换此方法体 startPollSure: function (containerId) { // mock: 扫码成功遮罩保持展示,等待真实接口实现 }, reloadQr: function (containerId) { var that = this; that.stopAll(); that.activeContainerId = containerId; if (!that.renderContainer(containerId)) return; that.setState(containerId, '正在生成二维码...'); var ctx = ''; var service = that.getServiceParam(); var $img = $('#' + containerId).find('.yxy-qr-img'); $img.attr('src', ctx + '/ymQrcodeTokenGenerate?service=' + encodeURIComponent(service) + '&_t=' + new Date().getTime()); $img.off('load.yxy error.yxy'); $img.on('load.yxy', function () { that.setState(containerId, ''); that.showOverdue(containerId, false); // 绑定刷新按钮 $('#' + containerId).find('.yxy-qr-refresh').off('click.yxy').on('click.yxy', function () { that.reloadQr(containerId); }); // 绑定扫码成功遮罩的取消按钮:调取消接口后刷新码 $('#' + containerId).find('.yxy-qr-cancel').off('click.yxy').on('click.yxy', function () { var ctx = ''; $.ajax({ url: ctx + '/ymQrcodeTokenCancel', type: 'GET', complete: function () { that.reloadQr(containerId); } }); }); // 开始轮询扫码状态 that.startPollScan(containerId); }); $img.on('error.yxy', function () { that.setState(containerId, '二维码生成失败,请刷新重试'); that.showOverdue(containerId, true); $('#' + containerId).find('.yxy-qr-refresh').off('click.yxy').on('click.yxy', function () { that.reloadQr(containerId); }); }); } }; // 向指定容器注入易校园扫码(使用后端生成二维码图片 + 轮询) function initYixiaoyuanQrToContainer(containerId) { try { if (!containerId) return; yxyScan.reloadQr(containerId); } catch (e) { var container = document.getElementById(containerId); if (container) { container.innerHTML = '
易校园登录加载失败,请刷新重试
'; } } } // ========================= // 微信扫码登录(独立模块) // ========================= var wxmScan = { scanIntervalId: -1, sureIntervalId: -1, _pollScanTimer: null, _pollSureTimer: null, currentToken: '', activeContainerId: '', getServiceParam: function () { var u = new URL(window.location.href); return u.searchParams.get('service') || ''; }, stopAll: function () { this.stopPollScan(); this.stopPollSure(); if (this.currentToken) { try { $.post('/wxmpQrcodeTokenCancel', { date: new Date().getTime() }); } catch (e) {} this.currentToken = ''; } this.activeContainerId = ''; }, stopScanOnly: function () { if (this.scanIntervalId !== -1) { clearInterval(this.scanIntervalId); this.scanIntervalId = -1; } }, setState: function (containerId, msg) { var $msg = $('#' + containerId).find('.wxm-qr-msg'); if (typeof msg === 'string') $msg.text(msg); }, renderContainer: function (containerId) { var container = document.getElementById(containerId); if (!container) return false; container.innerHTML = '' + '
' + '
' + '

' + '
使用微信扫码

' + '
继续使用统一身份认证
' + '
' + '
' + '
' + ' 请按照操作说明完成绑定后再登录 《绑' + ' ' + ' ' + '
' + '
' + '
' + ''; return true; }, showOverdue: function (containerId, show, msg) { var $box = $('#' + containerId).find('.wxmp-qr-box'); if (show === false) { $box.find('.wxm-qr-overdue').hide(); } else { if (msg) $box.find('.wxm-qr-overdue span:first').text(msg); $box.find('.wxm-qr-overdue').css('display', 'flex'); } $box.find('.wxm-qr-scaned').hide(); }, showScaned: function (containerId) { var $box = $('#' + containerId).find('.wxmp-qr-box'); $box.find('.wxm-qr-scaned').css('display', 'flex'); $box.find('.wxm-qr-overdue').hide(); }, startPollScan: function (containerId) { var that = this; that.stopPollScan(); that._pollScanTimer = setInterval(function () { var ctx = ''; $.ajax({ url: ctx + '/wxmpValidateQrcodeTokenHadScan', type: 'GET', success: function (res) { var code, msg; if (res && typeof res === 'object') { code = String(res.code).trim(); msg = res.msg || ''; } else { code = $.trim(String(res)); msg = ''; } if (code === '5') { locations.reload(true); } else if (code === '3') { // 等待中 } else if (code === '0' || code === '4') { that.showScaned(containerId); } else { that.showOverdue(containerId, true, msg || ''); } }, error: function () {} }); }, 2000); }, stopPollScan: function () { if (this._pollScanTimer) { clearInterval(this._pollScanTimer); this._pollScanTimer = null; } }, startPollSure: function (containerId) {}, stopPollSure: function () { if (this._pollSureTimer) { clearInterval(this._pollSureTimer); this._pollSureTimer = null; } }, reloadQr: function (containerId) { var that = this; that.stopAll(); that.activeContainerId = containerId; if (!that.renderContainer(containerId)) return; that.setState(containerId, '正在生成二维码...'); var ctx = ''; var service = that.getServiceParam(); var $img = $('#' + containerId).find('.wxm-qr-img'); $img.attr('src', ctx + '/wxmpQrcodeTokenGenerate?service=' + encodeURIComponent(service) + '&_t=' + new Date().getTime()); $img.off('load.wxm error.wxm'); $img.on('load.wxm', function () { that.setState(containerId, ''); that.showOverdue(containerId, false); $('#' + containerId).find('.wxm-qr-refresh').off('click.wxm').on('click.wxm', function () { that.reloadQr(containerId); }); $('#' + containerId).find('.wxm-qr-cancel').off('click.wxm').on('click.wxm', function () { var ctx = ''; $.ajax({ url: ctx + '/wxmpQrcodeTokenCancel', type: 'GET', complete: function () { that.reloadQr(containerId); } }); }); that.startPollScan(containerId); }); $img.on('error.wxm', function () { that.setState(containerId, '二维码生成失败,请刷新重试'); that.showOverdue(containerId, true); $('#' + containerId).find('.wxm-qr-refresh').off('click.wxm').on('click.wxm', function () { that.reloadQr(containerId); }); }); } }; // 向指定容器注入微信扫码 function initWxmpQrToContainer(containerId) { try { if (!containerId) return; wxmScan.reloadQr(containerId); } catch (e) { var container = document.getElementById(containerId); if (container) { container.innerHTML = '
微信登录加载失败,请刷新重试
'; } } } // 新版布局并存模式:当前 banner 扫码类型 'wecom' | 'dingtalk' | 'yixiaoyuan' | 'wxmp' var bannerScanType = 'wecom'; // 并存模式:切换 banner 扫码方式 function switchBannerScanType(type) { if (bannerScanType === type) return; var $container = $('#banner-scan-qrcode-container'); if (!$container.length) return; var $bannerBox = $('#login-qrcode-banner-combined'); if ($bannerBox.length) { $bannerBox.removeClass('scan-type-yixiaoyuan').removeClass('scan-type-wxmp'); } if (type === 'dingtalk') { // 切走易校园/微信时停止轮询并取消 token yxyScan.stopAll(); wxmScan.stopAll(); if (wecomInitDelayTimer) { clearTimeout(wecomInitDelayTimer); wecomInitDelayTimer = null; } destroyWecomLogin('banner-scan-qrcode-container'); initDingTalkQrToContainer('banner-scan-qrcode-container'); $('.wecom-loading-text-combined').text('钉钉扫码登录'); $('.qrcode-usage-title-text').text('钉钉扫码登录'); $('.qrcode-usage-tip-scan-hint').text('请使用钉钉扫描二维码登录'); $('.qrcode-usage-info-tips .qrcode-usage-tip-combined').text('已绑定钉钉账号的用户:可直接扫码登录'); if (dingtalkBindOrUnbingUrl) { $('.qrcode-usage-tip-info-combined').html('未绑定钉钉账号的用户:请按照操作说明完成绑定后再登录《绑定和解绑操作说明》'); } else { $('.qrcode-usage-tip-info-combined').text('未绑定钉钉账号的用户:请先在系统中完成绑定后再登录。'); } $('#login-qrcode-banner-combined .agreement-wecom').hide(); $('#login-qrcode-banner-combined .agreement-dingtalk').show(); // 只显示钉钉说明(h1 + hover 展开内容) $('#banner-inner-show .winxin-desc').hide(); $('#banner-inner-show .dingding-desc').show(); $('#banner-inner-show .yixiaoyuan-desc').hide(); $('#banner-inner-show .wxmp-desc').hide(); if ($bannerBox.length) { $bannerBox.removeClass('scan-type-wecom').removeClass('scan-type-yixiaoyuan').removeClass('scan-type-wxmp').addClass('scan-type-dingtalk'); } } else if (type === 'yixiaoyuan') { if (wecomInitDelayTimer) { clearTimeout(wecomInitDelayTimer); wecomInitDelayTimer = null; } // 避免企业微信 loading 遮罩残留覆盖其它扫码方式 hideWecomLoading('banner-scan-qrcode-container'); destroyWecomLogin('banner-scan-qrcode-container'); wxmScan.stopAll(); $container.empty(); initYixiaoyuanQrToContainer('banner-scan-qrcode-container'); $('.wecom-loading-text-combined').text('易校园扫码登录'); $('.qrcode-usage-title-text').text('易校园扫码登录'); $('.qrcode-usage-tip-scan-hint').text('请使用易校园扫描二维码登录'); $('.qrcode-usage-info-tips .qrcode-usage-tip-combined').text('已绑定易校园账号的用户:可直接扫码登录'); if (yixiaoyuanBindOrUnbingUrl && yixiaoyuanBindOrUnbingUrl !== 'null' && yixiaoyuanBindOrUnbingUrl !== '') { $('.qrcode-usage-tip-info-combined').html('未绑定易校园账号的用户:请按照操作说明完成绑定后再登录《绑定和解绑操作说明》'); } else { $('.qrcode-usage-tip-info-combined').text('未绑定易校园账号的用户:请先在系统中完成绑定后再登录。'); } $('#login-qrcode-banner-combined .agreement-dingtalk').hide(); $('#login-qrcode-banner-combined .agreement-wecom').hide(); $('#banner-inner-show .winxin-desc').hide(); $('#banner-inner-show .dingding-desc').hide(); $('#banner-inner-show .yixiaoyuan-desc').show(); $('#banner-inner-show .wxmp-desc').hide(); if ($bannerBox.length) { $bannerBox.removeClass('scan-type-dingtalk').removeClass('scan-type-wecom').removeClass('scan-type-wxmp').addClass('scan-type-yixiaoyuan'); } } else if (type === 'wxmp') { if (wecomInitDelayTimer) { clearTimeout(wecomInitDelayTimer); wecomInitDelayTimer = null; } hideWecomLoading('banner-scan-qrcode-container'); destroyWecomLogin('banner-scan-qrcode-container'); yxyScan.stopAll(); $container.empty(); initWxmpQrToContainer('banner-scan-qrcode-container'); $('.wecom-loading-text-combined').text('微信扫码登录'); $('.qrcode-usage-title-text').text('微信扫码登录'); $('.qrcode-usage-tip-scan-hint').text('请使用微信扫描二维码登录'); $('.qrcode-usage-info-tips .qrcode-usage-tip-combined').text('已绑定微信公众号的用户:可直接扫码登录'); if (wxmpBindOrUnbingUrl && wxmpBindOrUnbingUrl !== 'null' && wxmpBindOrUnbingUrl !== '') { $('.qrcode-usage-tip-info-combined').html('未绑定微信公众号的用户:请按照操作说明完成绑定后再登录《绑定和解绑操作说明》'); } else { $('.qrcode-usage-tip-info-combined').text('未绑定微信公众号的用户:请先在系统中完成绑定后再登录。'); } $('#login-qrcode-banner-combined .agreement-dingtalk').hide(); $('#login-qrcode-banner-combined .agreement-wecom').hide(); $('#banner-inner-show .winxin-desc').hide(); $('#banner-inner-show .dingding-desc').hide(); $('#banner-inner-show .yixiaoyuan-desc').hide(); $('#banner-inner-show .wxmp-desc').show(); if ($bannerBox.length) { $bannerBox.removeClass('scan-type-dingtalk').removeClass('scan-type-wecom').removeClass('scan-type-yixiaoyuan').addClass('scan-type-wxmp'); } } else { // 切走易校园/微信时停止轮询并取消 token yxyScan.stopAll(); wxmScan.stopAll(); $container.empty(); initWecomLogin('banner-scan-qrcode-container', false); $('.wecom-loading-text-combined').text('正在加载企业微信...'); $('.qrcode-usage-title-text').text('企业微信扫码登录'); $('.qrcode-usage-tip-scan-hint').text('请使用企业微信扫描二维码登录'); $('.qrcode-usage-info-tips .qrcode-usage-tip-combined').text('已绑定企业微信的用户:可直接扫码登录'); $('.qrcode-usage-tip-info-combined').html('未绑定企业微信的用户:请按照操作说明完成绑定后再登录《绑定和解绑操作说明》'); $('#login-qrcode-banner-combined .agreement-dingtalk').hide(); $('#login-qrcode-banner-combined .agreement-wecom').show(); // 只显示企业微信说明(h1 + hover 展开内容) $('#banner-inner-show .winxin-desc').show(); $('#banner-inner-show .dingding-desc').hide(); $('#banner-inner-show .yixiaoyuan-desc').hide(); $('#banner-inner-show .wxmp-desc').hide(); if ($bannerBox.length) { $bannerBox.removeClass('scan-type-dingtalk').removeClass('scan-type-yixiaoyuan').removeClass('scan-type-wxmp').addClass('scan-type-wecom'); } } bannerScanType = type; $('#banner-other-login .other-login-item').removeClass('other-login-item-active'); $('#banner-other-login .other-login-item[data-scan-type="' + type + '"]').addClass('other-login-item-active'); } function switchForm(formId) { if ($('#login-phones').is(':visible')) { mobileLoginFormData.mobiles = $('#mobileLoginValue').val(); mobileLoginFormData.captcha = $('#secondaryloginphonecaptchaMobileLogin').val(); } $('#login-account').hide(); $('#login-phones').hide(); $('#login-qrcode-dingtalk').hide(); $('#login-qrcode-yixiaoyuan').hide(); $('#login-qrcode-wxmp').hide(); // 新布局模式下,banner内的login-qrcode不应该隐藏 if (!scanAtLeft) { $('#login-qrcode-tab').hide(); } else { // 新布局模式下,只隐藏登录表单区域的login-qrcode,不隐藏banner内的 $('.login-box-wrap #login-qrcode-tab').hide(); } // 新布局模式下,切换右侧tab不应该影响左侧banner内的扫码登录 if (!scanAtLeft) { if (formId !== 'login-qrcode') { destroyWecomLogin('qywxEwmIddefault-tab'); } } if(formId === 'login-qrcode') { $('#login-mima').hide(); // 切换到其他方式时停止易校园/微信轮询 if (formId !== 'login-qrcode-yixiaoyuan') { yxyScan.stopAll(); } if (formId !== 'login-qrcode-wxmp') { wxmScan.stopAll(); } // 根据设备类型和布局模式决定初始化哪个二维码 if (scanAtLeft && !isMobileDevice()) { // PC端新布局模式,banner内的二维码已经初始化,不需要重新初始化 // 只需要显示tab切换区域的二维码(虽然PC端不显示,但保持逻辑一致) } else { // 移动端或旧布局模式,初始化二维码,切换到企业微信 tab 时需要展示 loading initWecomLogin('qywxEwmIddefault', true); } } else if (formId === 'login-qrcode-dingtalk') { $('#login-mima').hide(); yxyScan.stopAll(); initDingTalkQr(); } else if (formId === 'login-qrcode-yixiaoyuan') { $('#login-mima').hide(); initYixiaoyuanQrToContainer('yixiaoyuan-qrcode-container'); } else if (formId === 'login-qrcode-wxmp') { $('#login-mima').hide(); initWxmpQrToContainer('wxmp-qrcode-container'); } else if (formId === 'login-phones') { $('#mobileLoginValue').val(mobileLoginFormData.mobiles); $('#secondaryloginphonecaptchaMobileLogin').val(mobileLoginFormData.captcha); $('#err-tip-input-mobiles').html(''); $('#err-tip-system-mobiles').remove(); $('#login-mima').show(); } else { yxyScan.stopAll(); $('#login-mima').show(); } // 新布局模式下,如果切换到login-qrcode,PC端不需要show tab区域的,因为banner内的已经显示了 // 移动端需要show tab区域的 if (formId === 'login-qrcode' && scanAtLeft && !isMobileDevice()) { // PC端新布局模式,banner内的login-qrcode已经显示,不需要show tab区域的 } else { // 根据formId决定显示哪个元素 if (formId === 'login-qrcode') { $('#login-qrcode-tab').show(); } else if (formId === 'login-qrcode-dingtalk') { $('#login-qrcode-dingtalk').show(); } else if (formId === 'login-qrcode-yixiaoyuan') { $('#login-qrcode-yixiaoyuan').show(); } else if (formId === 'login-qrcode-wxmp') { $('#login-qrcode-wxmp').show(); } else { $('#' + formId).show(); } } switch(formId){ case 'login-account': $('#passwordLogin').addClass('active'); $('#passwordLoginM').addClass('active'); $('#mobileLogin').removeClass('active'); $('#mobileLoginM').removeClass('active'); $('#wechatLogin').removeClass('active'); $('#dingtalkLogin').removeClass('active'); $('#yixiaoyuanLogin').removeClass('active'); $('#wxmpLogin').removeClass('active'); break; case 'login-phones': $('#passwordLogin').removeClass('active'); $('#passwordLoginM').removeClass('active'); $('#mobileLogin').addClass('active'); $('#mobileLoginM').addClass('active'); $('#wechatLogin').removeClass('active'); $('#dingtalkLogin').removeClass('active'); $('#yixiaoyuanLogin').removeClass('active'); $('#wxmpLogin').removeClass('active'); break; case 'login-qrcode': $('#passwordLogin').removeClass('active'); $('#passwordLoginM').removeClass('active'); $('#mobileLogin').removeClass('active'); $('#mobileLoginM').removeClass('active'); $('#wechatLogin').addClass('active'); $('#dingtalkLogin').removeClass('active'); $('#yixiaoyuanLogin').removeClass('active'); $('#wxmpLogin').removeClass('active'); break; case 'login-qrcode-dingtalk': $('#passwordLogin').removeClass('active'); $('#passwordLoginM').removeClass('active'); $('#mobileLogin').removeClass('active'); $('#mobileLoginM').removeClass('active'); $('#wechatLogin').removeClass('active'); $('#dingtalkLogin').addClass('active'); $('#yixiaoyuanLogin').removeClass('active'); $('#wxmpLogin').removeClass('active'); break; case 'login-qrcode-yixiaoyuan': $('#passwordLogin').removeClass('active'); $('#passwordLoginM').removeClass('active'); $('#mobileLogin').removeClass('active'); $('#mobileLoginM').removeClass('active'); $('#wechatLogin').removeClass('active'); $('#dingtalkLogin').removeClass('active'); $('#yixiaoyuanLogin').addClass('active'); $('#wxmpLogin').removeClass('active'); break; case 'login-qrcode-wxmp': $('#passwordLogin').removeClass('active'); $('#passwordLoginM').removeClass('active'); $('#mobileLogin').removeClass('active'); $('#mobileLoginM').removeClass('active'); $('#wechatLogin').removeClass('active'); $('#dingtalkLogin').removeClass('active'); $('#yixiaoyuanLogin').removeClass('active'); $('#wxmpLogin').addClass('active'); break; } } function setupLoginTabScroller() { var $ul = $('.login-box-tab .loginTab').first(); if (!$ul.length) return; // 仅统计可见 tab(有些会被 show/hide 控制),并计算总宽度(含 margin) var $items = $ul.children('li:visible'); var totalWidth = 0; $items.each(function () { totalWidth += $(this).outerWidth(true) || 0; }); // 可用宽度:以 tab 区域容器为准(保持和原样一致的居中布局) var $tabBox = $ul.closest('.login-box-tab'); var availableWidth = ($tabBox.length ? $tabBox.width() : $ul.parent().width()) || 0; // 若之前初始化过,先清理按钮与样式(便于在开关/窗口尺寸变化时重算) var $wrap = $ul.closest('.loginTab-scroll'); // 只要放得下就不启用滚动;放不下才启用左右箭头 + 不换行滚动 // 箭头采用绝对定位叠加,不占位,因此这里按实际宽度判断即可 // 同时:tab 数量 <= 4 时不启用箭头(超过4个才显示) var needScroll = $items.length > 4 && totalWidth > Math.max(0, availableWidth); if (!needScroll) { $ul.removeClass('loginTab--scrollable'); if ($wrap.length) { // 还原结构:移除按钮,把 ul 放回原处 var $parent = $wrap.parent(); $wrap.find('.loginTab-nav').remove(); $wrap.replaceWith($ul); $ul.scrollLeft(0); // 保持原有居中(父容器仍是 .login-box-tab) if ($parent && $parent.length) { // noop } } return; } // 初始化滚动容器 + 左右按钮(放不下时启用) $ul.addClass('loginTab--scrollable'); if (!$wrap.length) { $wrap = $('
'); $ul.before($wrap); $wrap.append($ul); $wrap.prepend(''); $wrap.append(''); } var $prev = $wrap.find('.loginTab-nav--prev'); var $next = $wrap.find('.loginTab-nav--next'); function updateNavState() { var maxScroll = $ul[0].scrollWidth - $ul[0].clientWidth; var cur = $ul[0].scrollLeft; $prev.prop('disabled', cur <= 0); $next.prop('disabled', cur >= (maxScroll - 1)); } function scrollTabItemIntoCenter(el) { try { if (!$ul.hasClass('loginTab--scrollable')) return; var ulEl = $ul[0]; var liEl = el; if (!ulEl || !liEl) return; var liCenter = liEl.offsetLeft + (liEl.offsetWidth / 2); var targetLeft = liCenter - (ulEl.clientWidth / 2); var maxLeft = Math.max(0, ulEl.scrollWidth - ulEl.clientWidth); if (targetLeft < 0) targetLeft = 0; if (targetLeft > maxLeft) targetLeft = maxLeft; ulEl.scrollTo({ left: targetLeft, behavior: 'smooth' }); // smooth 滚动过程中 scroll 事件会继续触发 updateNavState updateNavState(); } catch (e) { } } $prev.off('click.loginTab').on('click.loginTab', function () { $ul[0].scrollLeft = Math.max(0, $ul[0].scrollLeft - 180); updateNavState(); }); $next.off('click.loginTab').on('click.loginTab', function () { $ul[0].scrollLeft = Math.min($ul[0].scrollWidth, $ul[0].scrollLeft + 180); updateNavState(); }); $ul.off('scroll.loginTab').on('scroll.loginTab', updateNavState); // 点击边缘 tab 时自动滚动到中间附近(不影响原来的 $ul.children('li').off('click.loginTabScroll').on('click.loginTabScroll', function () { var el = this; // 让 switchForm 先执行(更新 active),再滚动更自然 setTimeout(function () { scrollTabItemIntoCenter(el); }, 0); }); updateNavState(); } function showModal(msg) { if (typeof Swal !== 'undefined') { Swal.fire({ icon: 'error', title: '登录失败', text: msg, confirmButtonText: '我知道了' }); } else { alert(msg); } }
\\n
\\n 版权所有@贵州中医药大学\\n \\n 地址:贵州省贵阳市花溪区栋青路4号\\n
\\n
\",\"desc\":\"版权信息\"}"},{"confkey":"cas_pc_fill_mode","confval":"{\"value\":\"center\",\"desc\":\"填充方式\"}"},{"confkey":"cas_pc_image_urls","confval":"{\"value\":\"[\\\"/api/eusp-cas-master/uploads/2026061214233243.png\\\"]\",\"desc\":\"背景图\"}"},{"confkey":"cas_pc_login_methods","confval":"{\"value\":{\"methods\":[\"account\",\"sms\"],\"accountLoginName\":\"学工号登录\",\"smsLoginName\":\"手机短信\"},\"desc\":\"手动登录方式\"}"},{"confkey":"cas_pc_captcha_enabled","confval":"true"},{"confkey":"cas_pc_captcha_type","confval":"slider"},{"confkey":"cas_pc_captcha_show_mode","confval":"always"},{"confkey":"cas_pc_agreement_enabled","confval":"{\"name\":\"\",\"enabled\":\"false\",\"href\":\"\",\"desc\":\"显示用户协议\"}"},{"confkey":"cas_pc_user_query_enabled","confval":"{\"name\":\"用户查询\",\"enabled\":\"true\",\"href\":\"https://e1.gzy.edu.cn/eone-password-pc-vue/account-search\",\"desc\":\"显示用户查询\"}"},{"confkey":"cas_pc_account_activation_enabled","confval":"{\"name\":\"账号激活\",\"enabled\":\"true\",\"href\":\"https://e1.gzy.edu.cn/eone-password-pc-vue/init-password\",\"desc\":\"显示账号激活\"}"},{"confkey":"cas_pc_forgot_password_enabled","confval":"{\"name\":\"忘记密码\",\"enabled\":\"true\",\"href\":\"https://e1.gzy.edu.cn/eone-password-pc-vue/find-password\",\"desc\":\"显示忘记密码\"}"},{"confkey":"cas_pc_suggest_browser_enabled","confval":"{\"value\":\"true\",\"desc\":\"显示建议浏览器\"}"},{"confkey":"cas_pc_position","confval":"{\"value\":\"left\",\"desc\":\"位置\"}"},{"confkey":"cas_pc_wecom_scan_help","confval":"{\"href\":\"https://wlzx.gzy.edu.cn/info/1103/1453.htm\",\"enabled\":\"true\",\"open\":\"true\",\"desc\":\"企业微信\"}"},{"confkey":"cas_pc_dingtalk_scan_help","confval":"{\"href\":\"\",\"enabled\":\"false\",\"open\":\"false\",\"desc\":\"钉钉\"}"},{"confkey":"cas_pc_ecampus_scan_help","confval":"{\"href\":\"\",\"enabled\":\"false\",\"open\":\"true\",\"desc\":\"易校园\"}"},{"confkey":"cas_mobile_logo_url","confval":"{\"value\":\"/api/eusp-cas-master/uploads/2026061121371369.svg\",\"desc\":\"LOGO\"}"},{"confkey":"cas_mobile_system_name","confval":"{\"value\":\"\",\"desc\":\"系统名称\"}"},{"confkey":"cas_mobile_theme_color","confval":"{\"value\":\"#99222e\",\"desc\":\"主题色\"}"},{"confkey":"cas_mobile_copyright","confval":"{\"value\":\"
\\n
\\n 版权所有@贵州中医药大学\\n
\\n
\\n 地址:贵州省贵阳市花溪区栋青路4号\\n
\\n \\n
\",\"desc\":\"版权信息\"}"},{"confkey":"cas_mobile_login_methods","confval":"{\"value\":{\"methods\":[\"account\",\"sms\"],\"accountLoginName\":\"学工号登录\",\"smsLoginName\":\"手机短信\"},\"desc\":\"手动登录方式\"}"},{"confkey":"cas_file_host","confval":"{\"value\":\"https://e1.gzy.edu.cn\",\"desc\":\"前端域名\"}"}]; } catch (e) { window.CAS_LOGIN_CONFIG.interfaceConfigs = []; } window.CAS_LOGIN_CONFIG.legacyConfigs = window.CAS_LOGIN_CONFIG.legacyConfigs || { cas_pc_browser_title_icon: 'https://e1.gzy.edu.cn/api/eusp-cas-master/uploads/2026061121235380.ico', cas_pc_fill_mode: '{"value":"center","desc":"填充方式"}', cas_pc_theme_color: '#99222e', cas_mobile_theme_color: '#99222e', cas_pc_browser_title_name: '统一身份认证', cas_pc_position: 'true', cas_file_host: '{"value":"https://e1.gzy.edu.cn","desc":"前端域名"}', cas_pc_image_urls: '{"value":"[\"/api/eusp-cas-master/uploads/2026061214233243.png\"]","desc":"背景图"}' };
如从搜索进入本页,可先确认栏目名称,再按相关阅读扩展浏览。

延伸阅读

本页围绕「世界杯网址大全世界杯shijiebei(中国」汇总公开信息,便于结合栏目动态与后续阅读。

移动端与电脑端入口保持一致。如某条暂不可用,可改走栏目列表继续查找。

列表适合快速定位,正文适合核对表述。两者都保留在站内即可形成完整阅读路径。

浏览栏目

用户查询 · 账号激活 · 首页 · 忘记密码

如从搜索进入本页,可先确认栏目名称,再按相关阅读扩展浏览。