|
@@ -9,7 +9,8 @@
|
|
|
<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 rel="preconnect" href="https://fonts.loli.net">
|
|
|
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
|
<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">
|
|
@@ -58,10 +59,12 @@
|
|
|
if (force) {
|
|
|
delCookie('CASTGC', '/')
|
|
|
delCookie('gosh', '/score/')
|
|
|
- delCookie('gosh', '/sso/')
|
|
|
- delCookie('gowd', '/sso/')
|
|
|
+ if (force <= 2) {
|
|
|
+ delCookie('gosh', '/sso/')
|
|
|
+ delCookie('gowd', '/sso/')
|
|
|
+ }
|
|
|
}
|
|
|
- if (force == 2) {
|
|
|
+ if (force >= 2) {
|
|
|
delCookie('JSESSIONID', '/bxn-portal/')
|
|
|
delCookie('JSESSIONID', '/bxn-library/')
|
|
|
delCookie('JSESSIONID', '/bxn-core-uic/')
|
|
@@ -70,6 +73,7 @@
|
|
|
delCookie('JSESSIONID', '/sso/')
|
|
|
}
|
|
|
function postLogin() {
|
|
|
+ console.log("POSTLOGIN")
|
|
|
if (status != 1) return;
|
|
|
if (!user) user = getCookie('gosh'), pwd = getCookie('gowd')
|
|
|
document.cookie = "gosh=" + user + ";path=/score/";
|
|
@@ -122,7 +126,7 @@
|
|
|
}),
|
|
|
credentials: 'include',
|
|
|
})
|
|
|
- }).then(e => e.text()).then(e => { return new Promise(() => setStatus((e != 'success') + 1)) })
|
|
|
+ }).then(e => e.text()).then(e => { setStatus((e != 'success') + 1), Promise.resolve() })
|
|
|
}
|
|
|
function matches(e) {
|
|
|
return e.match('(DOCTYPE|[/n]\\?username=|requestParams|\"newmessage\")')
|
|
@@ -139,10 +143,11 @@
|
|
|
function pre(e, url, call) {
|
|
|
if (e.match('北师大实验中学--登录')) {
|
|
|
console.log("ERR", e, url)
|
|
|
- delCookies(2)
|
|
|
+ delCookies(3)
|
|
|
setStatus(0)
|
|
|
+ tryLogin()
|
|
|
} else {
|
|
|
- $('#bxn'+url.split('bxn')[1].split('/')[0]).addClass('btn-success')
|
|
|
+ $('#bxn' + url.split('bxn')[1].split('/')[0]).addClass('btn-success')
|
|
|
call(e)
|
|
|
}
|
|
|
}
|
|
@@ -170,12 +175,19 @@
|
|
|
})
|
|
|
$('#changeBtn').addClass('btn-success')
|
|
|
}
|
|
|
- $().ready(() => {
|
|
|
- $('.e').addClass('reqLogin')
|
|
|
- $('.e').removeClass('e')
|
|
|
+ function tryLogin() {
|
|
|
if (getCookie('CASTGC')) {
|
|
|
setStatus(1), postLogin()
|
|
|
+ } else if (getCookie('gosh') && getCookie('gosh') != 'null') {
|
|
|
+ $('#loginId').val(getCookie('gosh'))
|
|
|
+ $('#loginPwd').val(getCookie('gowd'))
|
|
|
+ login().then(() => { status == 2 ? setStatus(0, 1) : postLogin() })
|
|
|
} else setStatus(0, 1)
|
|
|
+ }
|
|
|
+ $().ready(() => {
|
|
|
+ $('.e').addClass('reqLogin')
|
|
|
+ $('.e').removeClass('e')
|
|
|
+ tryLogin()
|
|
|
$("[data-toggle='tooltip']").tooltip();
|
|
|
})
|
|
|
</script>
|