<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>数字校园</title> <script type="text/javascript" src="/js/jquery.min.js"></script> <link rel="stylesheet" href="/css/bootstrap.min.css"> <script type="text/javascript" src="/js/bootstrap.min.js"></script> <script type="text/javascript" src="/js/md5.js"></script> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.loli.net/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400;1,700 &family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap" rel="stylesheet"> <link rel="stylesheet" href="/css/style.css"> <script> var status, oid, user, pwd const rot = '43.143.233.184:81', root = 'https://43.143.233.184:81/' function getCookie(name) { let arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)")); if (arr != null) return arr[2]; return null; } function delCookie(name, path = 'u') { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval = getCookie(name); if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() + ((path == 'u') ? '' : ';path=' + path) } function getUrl(e) { return e.replace('dd.sdsz.com.cn', rot).replace('http:', 'https:').replace(rot.split(':')[0] + '/', rot + '/') } function setStatus(e, fast) { status = e if (e == 1) { $('#loginSt').text('登录成功') $('.login').hide(200) $('#loginSt').addClass('label-success') $('#loginSt').removeClass('label-danger') $('.reqLogin').show(300) } else if (e == 2) { $('#loginSt').text('登录失败') $('#loginSt').removeClass('label-success') $('#loginSt').addClass('label-danger') } else { $('.login').show() $('#loginSt').text('未登录') $('#loginSt').removeClass('label-success') $('#loginSt').removeClass('label-danger') $('.reqLogin').hide(300 * !fast) $('#avatar').attr('src', '') $('#user').text('-') } } function delCookies(force) { if (force) { delCookie('CASTGC', '/') delCookie('gosh', '/score/') delCookie('gosh', '/sso/') delCookie('gowd', '/sso/') } if (force == 2) { delCookie('JSESSIONID', '/bxn-portal/') delCookie('JSESSIONID', '/bxn-library/') delCookie('JSESSIONID', '/bxn-core-uic/') } delCookie('JSESSIONID', '/') delCookie('JSESSIONID', '/sso/') } function postRes() { } function postLogin() { if (status != 1) return; if (!user) user = getCookie('gosh'), pwd = getCookie('gowd') document.cookie = "gosh=" + user + ";path=/score/"; document.cookie = "gosh=" + user + ";path=/sso/"; document.cookie = "gowd=" + pwd + ";path=/sso/"; $('#changePwd').val(pwd) // get('bxn-portal/portal/osforstudent/index', 0, e => { // let res = JSON.parse(e.match(/user_resources.*window\.admin/gs)[0].replace(/(?:user_resources =|window\.admin|([^)]);)/gs, '$1')) // console.log(res) // }) get('bxn-library/library/jumpExamreport?jumpUrl=http://36.112.23.77/analysis/auto/%23/autoLogin', 0, e => { $('#scoreOld').attr('href', e) }) get('bxn-portal/portal/api/proxy?username=true&userId=true&needvalidate=true&t=http%3A%2F%2F202.94.10.118%2Fbxn-library%2Fapi%2Flibrary%2FgetLatestBorrowBook%3Fcategory%3D1&resourceId=103519&cache=nocache&systime=0', 0, e => { e = JSON.parse(e) $('#user').text(e.requestParams[0].ownerName) oid = e.requestParams[0].ownerId console.log(oid) $('#avatar').attr('src', root + 'avatar/tiny/' + oid) }) get('bxn-portal/portal/api/proxy?username=true&userId=true&needvalidate=true&t=http%3A%2F%2F202.94.10.164%3A18030%2Fbxn-office%2Fapi%2Fmsg%2FgetLatestActivities&resourceId=100022&cache=nocache&systime=0', 0, e => { e = JSON.parse(e) $('#mailList').empty() for (let i = 0; i < e.list.length; i++) { $('#mailList').append('<li>' + e.list[i].typeZh + ': ' + e.list[i].title + '<span class="pull-right" style="color:rgb(144,144,144);">' + e.list[i].time + '</span></li>') } }) } function login() { if (status == 1) return; delCookies() user = $('#loginId').val(), pwd = $('#loginPwd').val() fetch(root + "sso/login", { "headers": { "content-type": "application/x-www-form-urlencoded; charset=UTF-8", // "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" }, "method": "GET", "mode": "cors", "credentials": 'include' }).then(() => { return fetch('https://43.143.233.184/andlogin', { method: 'POST', headers: { 'Content-type': 'application/json' }, body: JSON.stringify({ user: user, pwd: pwd, cook: getCookie('JSESSIONID') }), credentials: 'include', }) }).then(e => e.text()).then(e => { if (e == 'success') setStatus(1) else setStatus(2) }).then(postLogin) } function matches(e) { return e.match('(DOCTYPE|[/n]\\?username=|requestParams|\"newmessage\")') } async function next(e, call) {//异步递归嘿嘿嘿,再多 302 也不怕;再加上回调函数,真是妙 if (e.length < 3000 && !matches(e)) { return fetch(getUrl(e), { method: 'GET', credentials: 'include' }).then(e => e.text()).then(res => { next(res, call) }) } else return call(e), new Promise((resolve, reject) => { }) } function get(url, name, call = () => { }) { if (status != 1) return next(root + url, call) if (name) $('#' + name).addClass('btn-success') } function change() { if (status != 1 || pwd == $('#changePwd').val()) return var fd = new URLSearchParams() fd.append('rating', '4') fd.append('ratingWord', '极佳') fd.append('oldPassword', pwd) fd.append('newPassword', $('#changePwd').val()) fd.append('reNewPassword', $('#changePwd').val()) fetch(root + 'bxn-core-uic/uic-public/personal/management/password/save', { "headers": { "content-type": "application/x-www-form-urlencoded; charset=UTF-8", // "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" }, method: 'POST', body: fd, credentials: 'include', }) $('#changeBtn').addClass('btn-success') } $().ready(() => { $('.e').addClass('reqLogin') $('.e').removeClass('e') if (getCookie('CASTGC')) { setStatus(1), postLogin() } else setStatus(0, 1) $("[data-toggle='tooltip']").tooltip(); }) </script> <style> .form-control { font-weight: bold; font-family: 'Courier New', Courier, monospace; } li { border-bottom: 3px solid #eee; } li:hover { background-color: #eee; } .box::before { content: ''; display: block; width: 100%; height: 3px; margin-top: 10px; border-bottom: 1px solid; border-image: linear-gradient(to right, transparent, #1984d1, #10c482, transparent) 1; } .box:hover::before { border-bottom: 3px solid; } .page-header.nohr { margin-bottom: 0; border-bottom: none; } </style> </head> <body> <div class="page-header nohr"> <h2>数字校园 <button class="btn btn-default btn-xs"> <span class="glyphicon glyphicon-question-sign"></span> </button> </h2> <span id="loginSt" class="label label-default">未登录</span> <span id="user" class="label label-default">-</span> <button class="btn btn-danger btn-xs e" onclick="postLogin()"> <span class="glyphicon glyphicon-refresh"></span> </button> <button class="btn btn-danger btn-xs e" onclick="delCookies(1);setStatus(0)" onmouseenter="$('#double-off').css('scale','100%')" onmouseleave="$('#double-off').css('scale','0')"> <span class="glyphicon glyphicon-log-out"></span> </button> <button id="double-off" class="btn btn-danger btn-xs e" onclick="delCookies(2);location.reload()" onmouseenter="$('#double-off').css('scale','100%')" onmouseleave="$('#double-off').css('scale','0')" style="scale:0;transition-duration: 1000ms;" data-toggle="tooltip" data-placement="right" title="全部重置"> <span class="glyphicon glyphicon-off"></span> </button> <button class="btn btn-danger btn-xs login" onclick="delCookies(2);location.reload()" data-toggle="tooltip" data-placement="right" title="全部重置"> <span class="glyphicon glyphicon-off"></span> </button> <img id="avatar" style="position:absolute;right:10px;top:10px;"> </div> <div class="col-md-4 col-sm-6 box"> <div class="page-header"> <h3><span class="glyphicon glyphicon-user"></span> 账号 <div id="cookie" class="btn-group" style="display: none;"> <button id="bxn-portal" class="btn btn-default btn-xs" onclick="get('bxn-portal/portal/osforstudent/index','bxn-portal')">bxn-portal</button> <button id="bxn-core-uic" class="btn btn-default btn-xs" onclick="get('bxn-core-uic/uic/index','bxn-core-uic')">bxn-core-uic</button> <button id="bxn-library" class="btn btn-default btn-xs" onclick="get('bxn-library/library/jumpExamreport?jumpUrl=','bxn-library')">bxn-library</button> </div> </h3> </div> <button class="btn btn-default e" onclick="$('#change').toggle(200)">修改密码</button> <!-- <button class="btn btn-default e" onclick="$('#cookie').toggle(200)">cookie</button> --> <div class="login"> <br> <div class="input-group"> <span class="input-group-addon">账号</span> <input id="loginId" type="id" class="form-control" placeholder="20222222"> </div> <br> <div class="input-group"> <span class="input-group-addon">密码</span> <input id="loginPwd" type="password" class="form-control" placeholder="password"> <span class="input-group-btn"><button class="btn btn-default" type="button" onclick="login()">登录</button></span> </div> </div> <div id="change" style="display: none;"> <br> <div class="input-group"> <span class="input-group-addon">新密码</span> <input id="changePwd" type="password" class="form-control" placeholder="password" onmouseenter="this.type='id'" onmouseleave="this.type='password'"> <span class="input-group-btn"><button id="changeBtn" class="btn btn-default" type="button" onclick="change()">修改</button></span> </div> </div> </div> <div class="col-md-4 col-sm-6 box"> <div class="page-header"> <h3><span class="glyphicon glyphicon-stats"></span> 成绩</h3> </div> <div class="btn-group"> <a id="scoreOld" class="btn btn-default e" target="_blank">原版</a> <a class="btn btn-default e" href="/score" target="_blank">新版</a> </div> </div> <div class="col-md-4 col-sm-6 box"> <div class="page-header"> <h3><span class="glyphicon glyphicon-envelope"></span> 通知</h3> </div> <ul id="mailList" class="list-unstyled e"></ul> </div> <div style="position:absolute;bottom:10px;left:10px;color:#ccc"> 北师大实验中学 </div> </body>