<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="shortcut icon" href="/images/favicon.ico" />
<link rel="bookmark" href="/images/favicon.ico" type="image/x-icon" />
<title id="title">中国科学技术大学统一身份认证系统</title>
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="https://passport.ustc.edu.cn/css/ie7.css" />
<script src="https://passport.ustc.edu.cn/js/json2.js"></script>
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="https://passport.ustc.edu.cn/css/ie8.css" />
<![endif]-->
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="https://passport.ustc.edu.cn/css/ie.css" />
<![endif]-->
<!--ie 10 && 11 placeholder-->
<style>
@media all and (-ms-high-contrast:none)
{
.hide { color:#757575; } /* IE10 */
*::-ms-backdrop, .hide { color:#757575; } /* IE11 */
}
</style>
<script type="text/javascript" src="https://passport.ustc.edu.cn/js/jquery-3.4.1.min.js"></script>
<script src="https://passport.ustc.edu.cn/js/json2.js"></script>
<script src="https://passport.ustc.edu.cn/js/jquery-form.js"></script>
<!--JS/CSS 追加随机数,避免缓存 -->
<script>
var zhJson = 1611882835000;
var enJson = 1611882827000;
document.write('<link href="https://passport.ustc.edu.cn/css/ucas.css?v='+1607498348000+'" rel="stylesheet" type="text/css"/>');
document.write("<s"+"cript type='text/javascript' src='https://passport.ustc.edu.cn/js/ucas.js?v=?"+1611882672000+"'></scr"+"ipt>");
</script>
</head>
<body class="no-margin center">
<div class="body-cell">
<div class="box center" style="margin: 0 auto!important;">
<div class="qrcode" style="cursor:pointer;">
<img src="https://passport.ustc.edu.cn/images/qrcode.png" />
</div>
<div class="input_login" style="cursor:pointer;">
<img src="https://passport.ustc.edu.cn/images/input_login.png" />
</div>
<div class="card">
<p id="scanTitle" style="font-size:20px;height: 43px;">微信扫码登录</p>
<div id="header">
<input type="hidden" value="https://passport.ustc.edu.cn/" id="basePath"/>
<h1 class="header-logo">
<img id="header-img" src="https://passport.ustc.edu.cn/images/ucas/logo.svg" />
</h1>
<h1 class="header-des">
<img id="des-img" src="https://passport.ustc.edu.cn/images/ucas/des.svg" />
</h1>
</div>
<div id="divQrCode" style="display: none; position: relative; height: 210px;">
<div id="qrCode" style="position: absolute; left: 105px;width: 200px;">
<img src="" id="QrCodeImg" style="width: 180px;height: 180px"/>
</div>
<div id="model" style="display: none; right: 35px; position: absolute; right: 0; ">
<img style="margin-top: 10px;width: 140px;" src="https://passport.ustc.edu.cn/images/model.png" id="ModelImg" />
</div>
</div>
<form class="loginForm form-style" style="height: 210px" method="post" action="/login" accept-charset="UTF-8">
<input type="hidden" name="model" value="uplogin.jsp" />
<input type="hidden" id="service" name="service" value="https://www.ustc.edu.cn/system/resource/code/auth/caslogin.jsp?owner=1585251974" />
<input type="hidden" name="warn" value="" />
<input type="hidden" name="showCode" value="" />
<!-- 账户 -->
<div class="group">
<input id="username" class="input-box" name="username" type="text" size="30" placeholder="" value="" onfocus="" onblur="" required />
<span class="bar"></span>
</div>
<!-- 密码 -->
<div class="group" id="pd">
<input type="password" id="password" class="input-box" name="password" type="text" size="30" value="" placeholder="" onfocus="" onblur="" mark="password" required />
<span class="bar"></span>
</div>
<div class="bottom-box">
<select id="selector" title="locale" onchange="changeLang()" class="bottom-box-selector" style="height: 20px;line-height: 20px;padding: 0px 0;font-size: 10px">
<option id="zh" value="zh" selected="selected">中文</option>
<option id="en" value="en">English</option>
</select>
<a id="findPassword" href="#" onclick="goFindPassword();" class="bottom-box-button-area"></a>
<button id="login" type="submit" onclick="return check();" name="button" class="btn ripple bottom-box-button-area-1"></button>
</div>
<div class="sign" style="padding-top: 34px;display:none">
<h6 class="more-sign" id="more-sign"></h6>
<img style="width:40px;cursor: pointer;" src="https://passport.ustc.edu.cn/images/feishu.image" onclick="goFeishuLogin();" />
</div>
<div style="color:red;display:none;font-size:12px">当前为测试环境,请勿修改密码</div>
</form>
<a id="redirectUrl" href='' style="display:none"></a>
<!--display the contacts & copyright in footer-->
<div id="footer" class="footer">
<span id="phone" class="inline-block"></span>
<span id="email" class="inline-block"></span>
<span id="copyright" class="inline-block"></span>
<span id="version" style="display:none" class="inline-block">CAS v1.0 ©</span>
</div>
</div>
</div>
</div>
</body>
<script>
var clientLanguage = checkCookie();
$(function() {
$(".group").on("mouseover",function(){
if (IEVersion() < 12) {
var html = $(this).children("div").children("input").val();
if (html=="") {
this.title = $(this).children("div").children("span").html();
} else {
this.title = "";
}
} else {
var html = $(this).children("input").val();
if (html=="") {
this.title = $(this).children("input").attr('placeholder');
} else {
this.title = "";
}
}
});
getJsonContent(clientLanguage,false);
if (IEVersion()==7) {
$('head').append('<link href="https://passport.ustc.edu.cn/css/ie7.css" rel="stylesheet" type="text/css" />')
} else if (IEVersion()==8) {
$('head').append('<link href="https://passport.ustc.edu.cn/css/ie8.css" rel="stylesheet" type="text/css" />')
}
if (IEVersion()<12) {
$.getScript('/js/jquery.placeholder.js');
$("#header-img").attr("src","https://passport.ustc.edu.cn/images/ucas/logo.png");
if (clientLanguage == 'zh') {
$("#des-img").attr("src","https://passport.ustc.edu.cn/images/ucas/des.png");
} else {
$("#des-img").attr("src","https://passport.ustc.edu.cn/images/ucas/des-en.png");
}
} else {
$("#header-img").attr("src","https://passport.ustc.edu.cn/images/ucas/logo.svg");
if (clientLanguage == 'zh') {
$("#des-img").attr("src","https://passport.ustc.edu.cn/images/ucas/des.svg");
} else {
$("#des-img").attr("src","https://passport.ustc.edu.cn/images/ucas/des-en.svg");
}
}
})
</script>
</html>
<script>
//去找回密码页面
function goFindPassword(){
var basePath = $("#basePath").val();
var service='https://www.ustc.edu.cn/system/resource/code/auth/caslogin.jsp?owner=1585251974';
if(service !=null && service !=''){
window.location.href="https://passport.ustc.edu.cn/"+'findPassword.jsp?service='+service;
}else{
window.location.href="https://passport.ustc.edu.cn/"+'findPassword.jsp';
}
}
function goFeishuLogin(){
var basePath = $("#basePath").val();
var service='https://www.ustc.edu.cn/system/resource/code/auth/caslogin.jsp?owner=1585251974';
var redirectUrl = "";
if(service !=null && service !=''){
redirectUrl = "https://passport.ustc.edu.cn/"+'login?service='+service;
}else{
redirectUrl = "https://passport.ustc.edu.cn/"+'login';
}
var url = "https://open.zjurl.cn/open-apis/authen/v1/index?app_id="+appId+"&has_trans=1&redirect_uri="+redirectUrl+"&state=FROM-FS";
window.location.href=url;
}
var browser;
//获取浏览器信息
function getBrowserInfo(){
var Sys = {};
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
if(isIE) {
var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent);
var fIEVersion = parseFloat(RegExp["$1"]);
if(fIEVersion == 7) {
Sys.browser ='MSIE';
Sys.ver = 7;
return Sys;
} else if(fIEVersion == 8) {
Sys.browser ='MSIE';
Sys.ver = 8;
return Sys;
} else if(fIEVersion == 9) {
Sys.browser ='MSIE';
Sys.ver = 9;
return Sys;
} else if(fIEVersion == 10) {
Sys.browser ='MSIE';
Sys.ver = 10;
return Sys;
} else {
Sys.browser ='MSIE';
Sys.ver = 6;
return Sys;
}
} else if(isIE11) {
Sys.browser ='MSIE';
Sys.ver = 11;
return Sys;
} else if(isEdge) {
Sys.browser ='edge';
Sys.ver = 12;
return Sys;
}else{
Sys.browser ='other';
Sys.ver = 12;
return Sys;
}
return Sys;
}
//刷新验证码
function randomcode_refresh() {
var date = new Date().getTime();
$(".validate-img").attr("src", "validatecode.jsp?type=login&x=" + date);
}
//刷新二维码
function refreshqrCode() {
var service = $("#service").val();
var basePath = $("#basePath").val();
var language=$('#selector').val();//选择语言
$.get(basePath + "CodeServlet?service=" + service + "&cd=" + (new Date()).getTime()+"&language="+language, function(data, status) {
var arr = data.split("&&");
//存储UUID
uuid = arr[0];
//显示二维码
$("#QrCodeImg").attr("src", "data:image/png;base64," + arr[1]);
$("#QrCodeImg").css("left", "0px");
createTime = (new Date()).getTime();
//重新加载定时器
outTimeFlag = false;
window.setInterval("isOutTime()", 1000);
$("#QrCodeImg").css("margin-top", "");
});
}
//每隔一秒秒执行一次
$(function() {
$(".qrcode").show();
//非PC端关闭扫码界面
if(IsPC()==false){
$(".qrcode").hide();
};
browser=getBrowserInfo();
});
//是否超时标记
var scanLogin=false;
var outTimeFlag = false;
var createTime = (new Date()).getTime();
//二维码失效判断
function isOutTime() {
var outTime = '180';
if (outTime != null && outTime != '' && outTimeFlag == false) {
var time = (new Date()).getTime() - createTime;
if ((outTime * 1000) < time) {
outTimeFlag = true;
if (outTimeFlag = true) {
var lang=$("#selector").val();
if(lang !='en'){
$("#QrCodeImg").attr('src', "https://passport.ustc.edu.cn/images/ucas/InvalidRqCode.png");
}else{
$("#QrCodeImg").attr('src', "https://passport.ustc.edu.cn/images/ucas/InvalidRqCode-en.png");
}
$("#QrCodeImg").css("margin-top", "18px");
$("#QrCodeImg").unbind("click");
$("#QrCodeImg").bind("click", function() {
refreshqrCode();
});
//清除定时器
window.clearInterval(interval);
}
}
}
}
function changeWidth(){
var width = $(window).width();
if (width>=421 && width<1260) {
$('#qrCode').css("left","76px");
} else {
$('#qrCode').css("left","105px");
}
//针对IE做处理
if(browser.browser=="msie"){
if(browser.ver=="8.0"){
$('#qrCode').css("left","100px");
$('.card').css("padding","12 8 8 3");
}
if(browser.ver=="7.0"){
$('#qrCode').css("left","70px");
}
if(browser.ver=="6.0"){
$('#qrCode').css("left","40px");
}
}
}
//检测窗口变化
$(window).resize(function() {
changeWidth();
//非PC端关闭扫码界面
if(IsPC()==false){
$(".qrcode").hide();
if(scanLogin){
scanLogin=false;
outTimeFlag=false;
$(".input_login").hide();
$("#divQrCode").hide();
$(".loginForm").show();
$("#header").show();
$("#footer").show();
$("#footMsg").remove();
$("#scanTitle").hide();
}
}else{
$(".qrcode").show();
}
});
// 鼠标滑入显示二维码提示
$(function() {
hoverFlag=true;
var br=getBrowserInfo();
changeWidth();
//针对IE做处理,IE6 IE7没有切换动画
if(browser.browser=="msie"){
if(browser.ver =="7.0" || browser.ver =="6.0"){
hoverFlag=false;
}
}
if(hoverFlag==true){
$('#divQrCode').hover(function() {
if(outTimeFlag==false){
$('#qrCode').stop().animate({
'left' : 0
}, 300, function() {
$('#model').show();
var width = $(window).width();
if (width>=421 && width<1260) {
$("#model").css("right", "10px");
} else {
$("#model").css("right", "25px");
}
})
}
}, function() {
$('#model').hide();
var width = $(window).width();
if (width>=421 && width<1260) {
$('#qrCode').stop().animate({ 'left' : '76px'}, 300)
} else {
$('#qrCode').stop().animate({ 'left' : '105px'}, 300)
}
})
}
var showCode = '';
if (showCode == '1') {
var html = '';
html += "<div class='validate' id='valiCode'>";
html += " <div class='validate-input-area'>";
html += " <div class='group'>";
html += " <input id='validate' class='input-box' name='LT' size='8' type='text' placeholder='' value='' onfocus='' onblur='' required/>";
html += " <span class='bar'></span>";
html += " </div>";
html += " </div>";
html += " <div class='validate-img-area'>";
html += " <div class='group' style='text-align: right;'>";
html += " <img onClick='randomcode_refresh()' class='validate-img' style='height:32px;margin-top: -8px;overflow: visible'/>";
html += " </div>";
html += " </div>";
html += "</div>";
$("#pd").after(html);
}
$("#username").focus();
$(".validate-img").attr('src', "validatecode.jsp?type=login");
var type = '';
if (type == 1 || type == 3) {
var count = "";
var maxCount = 0;
if ('' == '0') {
maxCount = parseInt("");
} else if ('' == '1') {
maxCount = parseInt("");
}
if ('' == '0') {
if (clientLanguage == "zh") {
alert("登录密码错误次数还有" + (maxCount - count) + "次将超过最大次数将账号锁定!");
} else if (clientLanguage == "en") {
alert("The number of login password errors will be " + (maxCount - count)+ " more than the maximum number of times!");
}
}
}
if (type == 2 || type == 3) {
var count = "";
var maxCount = 0;
if ('' == '0') {
maxCount = parseInt("");
} else if ('' == '1') {
maxCount = parseInt("");
}
if ('' == '0') {
if (clientLanguage == "zh") {
alert("登录密码错误次数还有" + (maxCount - count) + "次将超过最大次数将IP锁定!");
} else if (clientLanguage == "en") {
alert("The number of login password errors will be " + (maxCount - count)+ " more than the maximum number of times!");
}
}
}
var msg = "";
if (msg != '') {
alert(msg);
}
if ('' == '1' || '' == '1') {
var time = "";
var ipTime = "";
var stage = "";
var ipStage = "";
$("#page").hide();
//location.href = "error.jsp?time=" + time + "&ipTime=" + ipTime + "&stage=" + stage + "&ipStage=" + ipStage;
$('#redirectUrl').attr('href',"error.jsp?time=" + time + "&ipTime=" + ipTime + "&stage=" + stage + "&ipStage=" + ipStage);
document.getElementById("redirectUrl").click();
}
});
function check() {
var id = $("#username").val();
var pwd = $("#password").val();
var rand = $("#validate").val();
var showCode = '';
$("#showCode").val(showCode);
if (id == "") {
if (clientLanguage == "zh") {
alert("请输入账号!");
} else if (clientLanguage == "en") {
alert("Please input Username!");
}
$("#username").focus();
return false;
}
if (pwd == "") {
if (clientLanguage == "zh") {
alert("请输入密码!");
} else if (clientLanguage == "en") {
alert("Please enter your Password!");
}
$("#password").focus();
return false;
}
if (showCode == '1' && rand == "") {
if (clientLanguage == "zh") {
alert("请输入验证码!");
} else if (clientLanguage == "en") {
alert("Please enter verification code!");
}
$("#validate").focus();
return false;
} else if (showCode == '1' && rand != "") {
$("#validate").val(rand.toLowerCase());
}
return true;
}
//判断设备是否PC
function IsPC() {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"];
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
}
//去帮助页面
function goHelp(){
window.location.href="https://passport.ustc.edu.cn/"+"weChatScanLoginPCHelp.jsp"
}
</script>