index.html 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. <!DOCTYPE html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  4. <title>北师大实验中学数字校园</title>
  5. <script type="text/javascript" src="/js/jquery.min.js"></script>
  6. <link rel="stylesheet" href="/css/bootstrap.min.css">
  7. <script type="text/javascript" src="/js/bootstrap.min.js"></script>
  8. <link rel="preconnect" href="https://fonts.googleapis.com">
  9. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  10. <link href="/css/css2.css" rel="stylesheet">
  11. <link rel="stylesheet" href="/css/style.css">
  12. <script>
  13. var status = 0, oid, user, pwd, paused = []
  14. const rot = '43.143.233.184:81', root = 'https://43.143.233.184:81/'
  15. function getCookie(name) {
  16. let arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
  17. if (arr != null) return arr[2];
  18. return null;
  19. }
  20. function delCookie(name, path = 'u') {
  21. var exp = new Date();
  22. exp.setTime(exp.getTime() - 1);
  23. var cval = getCookie(name);
  24. if (cval != null)
  25. document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() + ((path == 'u') ? '' : ';path=' + path)
  26. }
  27. function getUrl(e) {
  28. return e.replace('dd.sdsz.com.cn', rot).replace(/^http:/, 'https:').replace(rot.split(':')[0] + '/', rot + '/').replace('service=http%3A%2F%2F' + root, 'service=http%3A%2F%2Fdd.sdsz.com.cn')
  29. }
  30. function setStatus(e, fast) {
  31. console.log('STATUS', e)
  32. status = e
  33. if (e == 1) {
  34. paused = []
  35. $('#loginSt').text('登录成功')
  36. $('.login').hide(200)
  37. $('#loginSt').addClass('label-success')
  38. $('#loginSt').removeClass('label-danger')
  39. $('.reqLogin').show(300)
  40. } else if (e == 2) {
  41. $('#loginSt').text('登录失败')
  42. $('#loginSt').removeClass('label-success')
  43. $('#loginSt').addClass('label-danger')
  44. } else {
  45. $('.login').show(200)
  46. $('#loginSt').text('未登录')
  47. $('#loginSt').removeClass('label-success')
  48. $('#loginSt').removeClass('label-danger')
  49. $('.reqLogin').hide(300 * !fast)
  50. $('#avatar').attr('src', '')
  51. $('#user').text('-')
  52. }
  53. }
  54. function delCookies(force = 0) {
  55. if (force) {
  56. delCookie('CASTGC', '/')
  57. delCookie('gosh', '/score/')
  58. if (force <= 2) {
  59. delCookie('gosh', '/sso/')
  60. delCookie('gowd', '/sso/')
  61. }
  62. }
  63. if (force >= 2) {
  64. delCookie('JSESSIONID', '/bxn-portal/')
  65. delCookie('JSESSIONID', '/bxn-library/')
  66. delCookie('JSESSIONID', '/bxn-core-uic/')
  67. }
  68. delCookie('JSESSIONID', '/')
  69. delCookie('SSOID', '/')
  70. delCookie('JSESSIONID', '/sso/')
  71. }
  72. function getMail(from, i, id, uid) {
  73. $('.mil-' + i).toggleClass('active')
  74. if ($('.mail-' + i).text() == '') {
  75. get(`${['bxn-office/mails/user/showMailDetail?source=&mailItemId', 'bxn-office/messages/sys/sysMsgDetail?unwrap=true&sysMsgId', 'bxn-office/notices/user/getNoticeDetail?unwrap=true&noticeId'][from]}=${id}${['&userMailItemId=', '&ownerId=', ''][from]}${uid || ''}${['', '&_=0', '&_=0'][from]}`, e => {
  76. f = ''
  77. if (from == 0) {
  78. f = `<a onclick="$(this).hasClass('confirm')?removeMail('${uid}'):$(this).addClass('confirm').html('<span class=\\'glyphicon glyphicon-trash\\'></span> 确认?')"><span class="glyphicon glyphicon-trash"></span> 删除邮件</a>`
  79. if (e.match('"下载"')) {
  80. f += '<br>' + e.replace(/.*?ico.*?(bxn-office\/a.*?)title.*?file-info">(.*?)<.*?/gs, '<a href="https://43.143.233.184:81/$1>~ $2</a>,\n').split('/span')[0].replace(/,/g, '<br>').replace(/~/g, '<span class="glyphicon glyphicon-link"></span>')
  81. }
  82. e = e.replace(/^.*"bbcode-content">(.*?)<\/div>.*/gs, '$1')
  83. } else if (from == 1) {
  84. e = e.replace(/.*容:<\/label>(.*?)<\/p>.*/gs, '$1')
  85. } else if (from == 2) {
  86. if (e.match('"下载"')) {
  87. f = e.replace(/.*件:.*?<a.*?(<a.*?href=")(.*?) .*?fo">[ \t\n\r]*(.*?)[ \t\n\r]*<.*/gs, '$1https://43.143.233.184:81$2><span class="glyphicon glyphicon-link"></span> $3</a>')
  88. }
  89. e = e.replace(/.*?通..容:.*?tent">(.*?)<\/td.*/gs, '$1')
  90. }
  91. e = e.replace(/\[right\](.*?)\[\/right\]/gs, '<div class="pull-right">$1</div><br>').replace(/( *([\t\n\r ]|&nbsp;|<br>|<p><br\/><\/p>) *)+/g, '<br>').replace(/<br>(style|class)/g, ' $1').replace(/<br>$/gs, '')
  92. $('.mail-' + i).html(f + e)
  93. $('.mail-' + i).toggle(300)
  94. })
  95. } else {
  96. $('.mail-' + i).toggle(300)
  97. }
  98. }
  99. function getTime(time) {
  100. let a = new Date(), b = new Date(time)
  101. a.setHours(0)
  102. b.setHours(0)
  103. let diff = Math.ceil(a.getTime() / 86400000) - Math.ceil(b.getTime() / 86400000)
  104. if (diff < 1) return '今天'
  105. if (diff < 2) return '昨天'
  106. if (diff < 3) return '前天'
  107. if (diff < 7) return diff + '天前'
  108. return time.split(' ')[0]
  109. }
  110. var mails = []
  111. function insertMail(e) {
  112. e = '[' + e.slice(0, e.length - 1) + ']'
  113. e = JSON.parse(e)
  114. $('#mailList').empty()
  115. e = e.concat(mails).sort(function (a, b) { return new Date(b.time) - new Date(a.time) });
  116. mails = e
  117. str = ''
  118. for (let i = 0; i < e.length; i++) {
  119. str += `<li class="mail mil-${i}"><span class="full" onclick="getMail(${e[i].from},${i},'${e[i].id}',${e[i].uid})"><b>${e[i].title}</b><span class="pull-right" style="color:#999;">${e[i].name} ${getTime(e[i].time)} <span class="full-time" style="color:#bbb;">${e[i].time.split(' ')[1]}</span></span></span><span class="mail-text mail-${i}"></span></span></li>`
  120. }
  121. $('#mailList').append(str)
  122. $('.mail-text,.full-time').hide()
  123. }
  124. function refreshMail() {
  125. mails = []
  126. $('#mailList').empty()
  127. $('#mailList').append('<il>获取中...</il>')
  128. get('bxn-office/mails/user/index', e => {
  129. // 这代码谁写的?真是太烂了,我一行就把他五行干掉了(是刚才的我写的)
  130. // e = e.replace(/\n^(?!.*(sender|mailDetail|mailItemId)).*$/gm, '').replace(/[\r\n ]+/g, '')
  131. // e = e.replace(/<(a|td|span)[^<]*>([^<]*)<\/\1>/g, ',$2')
  132. // e = e.replace(/<(a|td|span)[^<]*>([^<]*)<\/\1>/g, ',$2')
  133. // e = e.replace(/<tr[^"]*"([^"]*)"[^"]*"([^"]*)"><td[^>]*>/g, '\n,$1,$2').replace(/(.sender{\n|\t.*)/gm, '')
  134. // e = e.replace(/^,(.*),(.*),(.*),(.*),(.*),(.{10,10})(.{8,8})$/gm, '{"id":"$1","uid":"$2","name":"$3","title":"$5","time":"$6 $7"},').replace(/\n/g, '')
  135. e = e.replace(/.*?mailItemId=(.*?) .*?MailItemId=(.*?)>.*?sender">(.*?) ?<.*?tail">(.*?)<.*?tail">(.*?)</gs, '{"from":0,"id":$1,"uid":$2,"name":"$3","title":"$4","time":"$5"},').split('/td')[0]
  136. insertMail(e)
  137. })
  138. get('bxn-office/messages/sys/sysInfoList', e => {
  139. e = e.replace(/.*?a-id="(.*?)".*?erId="(.*?)".*?d-td t.*?>\n?[\t\n\r]*(.*?)\n?[\t\n\r]*<\/td>.*?>(.*?)</gs, '{"from":1,"id":"$1","uid":"$2","name":"<i>消息</i>","title":"$3","time":"$4"},').split('/td')[0]
  140. insertMail(e)
  141. })
  142. get('bxn-office/notices/user/received', e => {
  143. e = e.replace(/.*?ta-id="(.*?)".*?d-td.*?d-td .*?on"> ?(.*?)<.*?ta-id.*?>(.*?)<(?:.*?d-td){4,4}">[\t\n\r ]*(.*?)[\t\n\r ]*</gs, '{"from":2,"id":"$1","title":"$2","name":"<i>通知</i> - $3","time":"$4"},').split('/td')[0]
  144. insertMail(e)
  145. })
  146. }
  147. function postLogin() {
  148. debug('LOGIN DONE.', 'initiate fetching.')
  149. if (status != 1) return;
  150. if (!user) user = getCookie('gosh'), pwd = getCookie('gowd')
  151. document.cookie = "gosh=" + user + ";path=/score/;expires=Fri, 05 Feb 2077 12:34:56 GMT";
  152. document.cookie = "gosh=" + user + ";path=/sso/;expires=Fri, 05 Feb 2077 12:34:56 GMT";
  153. document.cookie = "gowd=" + pwd + ";path=/sso/;expires=Fri, 05 Feb 2077 12:34:56 GMT";
  154. $('#changePwd').val(pwd)
  155. get('bxn-library/library/jumpExamreport?jumpUrl=http://36.112.23.77/analysis/auto/%23/autoLogin', e => {
  156. $('#scoreOld').attr('href', e)
  157. })
  158. get('bxn-portal/portal/osforstudent/index', e => {
  159. let f = e.match(/'https:\/\/service.*?'/gs)[0].split("'")[1]
  160. $('.service').attr('href', f)
  161. $('.serviceLearn').attr('href', f + encodeURIComponent('/fe-pc/b/fe_leco_student/portal/?system_partition_gId=3'))
  162. })
  163. 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', e => {
  164. e = JSON.parse(e)
  165. $('#user').text(e.requestParams[0].ownerName)
  166. oid = e.requestParams[0].ownerId
  167. $('#avatar').attr('src', root + 'avatar/tiny/' + oid)
  168. })
  169. refreshMail()
  170. }
  171. function debug(e, str = '') {
  172. $('.debugList').append(`<li class="auto-warp"><b>${e}</b> ${str} <span class="pull-right" style="color:#999">${status}</span></li>`)
  173. }
  174. function login() {
  175. debug('LOGIN.')
  176. if (status == 1) return;
  177. delCookies()
  178. user = $('#loginId').val(), pwd = $('#loginPwd').val()
  179. return fetch(root + "sso/login", {
  180. "headers": {
  181. "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
  182. // "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"
  183. },
  184. "method": "GET",
  185. "mode": "cors",
  186. "credentials": 'include'
  187. }).then(() => {
  188. return fetch('https://43.143.233.184/andlogin', {
  189. method: 'POST',
  190. headers: { 'Content-type': 'application/json' },
  191. body: JSON.stringify({
  192. user: user,
  193. pwd: pwd,
  194. cook: getCookie('JSESSIONID')
  195. }),
  196. credentials: 'include',
  197. })
  198. }).then(e => e.text()).then(e => { setStatus((e != 'success') + 1), Promise.resolve() })
  199. }
  200. function matches(e) {
  201. return e.match(/(^\[\]$|param":"|<tr>|DOCTYPE|in\?username=|requestParams|\"newmessage\"|Sorry, Page Not Found|北师大实验中学--登录)/s)
  202. }
  203. // 异步递归嘿嘿嘿,再多 302 也不怕;再加上回调函数,真是妙
  204. async function next(e, call, ac, login) {
  205. if (e.length < 3000 && !matches(e) && (!e.match('\/login\\?') || login)) {
  206. return fetch(getUrl(e), {
  207. method: 'GET',
  208. credentials: 'include',
  209. headers: {
  210. Accept: ac
  211. }
  212. }).then(e => e.text()).then(res => { next(res, call, ac, login) })
  213. }
  214. else return call(e), new Promise((resolve, reject) => { })
  215. }
  216. function pre(e, url, call) {
  217. if (e.match('北师大实验中学--登录')) {
  218. debug('OUTDATED CAS! NEED RELOGIN')
  219. delCookie('CASTGC', '/')
  220. tryLogin()
  221. }
  222. if (e.length < 3000 && e.match('\/login\\?')) {
  223. var name = url.split('/')[0], f = paused.filter(e => e.name == name)
  224. debug('FAILED', url)
  225. if (url.match('\/login\\?')) return
  226. if (f.length) f[0].arr.push(url), f[0].carr.push(call)
  227. else {
  228. paused.push({ name: name, arr: [url], carr: [call] })
  229. debug('GET COOKIE...')
  230. get(name + '/casfailed.jsp', () => {
  231. let f = paused.filter(e => e.name == name)[0]
  232. for (let i = 0; i < f.arr.length; i++)get(f.arr[i], f.carr[i])
  233. paused.splice(paused.indexOf(f), 1)
  234. }, '*/*', 1)
  235. }
  236. } else {
  237. $('#bxn' + url.split('bxn')[1].split(/(\/|%2F)/)[0]).addClass('bg-success').addClass('text-success')
  238. if (status == 1) call(e)
  239. }
  240. }
  241. function get(url, call = () => { }, ac = '*/*', login = 0) {
  242. console.log("GET", url)
  243. debug('GET', url)
  244. if (status != 1) return
  245. next(root + url, e => { pre(e, url, call); }, ac, login)
  246. }
  247. function post(url, bd, call = () => { }) {
  248. fetch(root + url, {
  249. "headers": {
  250. "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
  251. },
  252. method: 'POST',
  253. body: bd,
  254. credentials: 'include'
  255. }).then(call)
  256. }
  257. function change() {
  258. if (status != 1 || pwd == $('#changePwd').val()) return
  259. var fd = new URLSearchParams()
  260. fd.append('rating', '4')
  261. fd.append('ratingWord', '极佳')
  262. fd.append('oldPassword', pwd)
  263. fd.append('newPassword', $('#changePwd').val())
  264. fd.append('reNewPassword', $('#changePwd').val())
  265. post('bxn-core-uic/uic-public/personal/management/password/save', fd, () => $('#changeBtn').addClass('btn-success'))
  266. }
  267. let trying = 0
  268. function tryLogin() {
  269. if (trying) return debug('LOGIN', 'already in progress.')
  270. if (getCookie('CASTGC')) {
  271. debug('LOGIN', 'using CAS.')
  272. setStatus(1), postLogin()
  273. } else if (getCookie('gosh') && getCookie('gosh') != 'null' && getCookie('gowd') != 'null') {
  274. debug('LOGIN', 'using stored cookie.')
  275. setStatus(0)
  276. trying = 1
  277. $('#loginId').val(getCookie('gosh'))
  278. $('#loginPwd').val(getCookie('gowd'))
  279. login().then(() => { status == 2 ? setStatus(0, 1) : (trying = 0, postLogin()); })
  280. } else debug('LOGIN', 'no available method.'), setStatus(0, 1)
  281. }
  282. scrollToBottom = () => {
  283. (function smoothscroll() {
  284. const currentScroll = document.documentElement.scrollTop || document.body.scrollTop; // 已经被卷掉的高度
  285. const clientHeight = document.documentElement.clientHeight; // 浏览器高度
  286. const scrollHeight = document.documentElement.scrollHeight; // 总高度
  287. if (scrollHeight - 10 > currentScroll + clientHeight) {
  288. window.requestAnimationFrame(smoothscroll);
  289. window.scrollTo(0, currentScroll + (scrollHeight - currentScroll - clientHeight) / 2);
  290. }
  291. })();
  292. };
  293. var mp = new Map(), ans = new Map()
  294. function getPar(e) {
  295. if (e === undefined) return ''
  296. let g = ans.get(e)
  297. if (!g) {
  298. if (e.parentId == 'null') g = `{id:'${e.param}',name:'${e.label}',rule:'${e.nextRuleId}'}`
  299. else g = getPar(mp.get(e.parentId)) + `,{id:'${e.param}',name:'${e.label}',rule:'${e.nextRuleId}'}`
  300. ans.set(e, g)
  301. }
  302. return g
  303. }
  304. var target = [], base
  305. function delRec(e) {
  306. target = target.filter(u => u != e)
  307. }
  308. function addRec(e, c, l) {
  309. if (target.filter(u => u == e).length) return
  310. $('#recSel').append(`<li onclick="delRec('${e}');$(this).remove()" style="cursor:pointer"><span style="font-size:10px">${e} ${c}</span> ${l}</li>`)
  311. target.push(e)
  312. }
  313. function getRec(re) {
  314. get(`bxn-office/participant-select/rule-id/${re.rule}/param/${re.id}?unwrap=true&_=0`, e => {
  315. e = JSON.parse(e)
  316. if (e.length == 0) { $('.s-' + re.id + '>a').hide(); return }
  317. $('#recList>li').hide()
  318. let str = ''
  319. for (let i = 0; i < e.length; i++) {
  320. mp.set(e[i].param, e[i])
  321. }
  322. for (let i = 0; i < e.length; i++) {
  323. let par = getPar(e[i])
  324. let full = ''
  325. if (e.filter(u => u.parentId == e[i].param).length) full = `setRec([${par}],1)`
  326. else full = `setRec([${par}])`
  327. if (e[i].nextRuleId === null) full = `addRec('${e[i].param}','${e[i].code}','${e[i].label}')`
  328. str += `<li class="${e[i].parentId} s-${e[i].param} ${e[i].nextRuleId === null ? 'endRec' : ''}">${e.filter(u => u.parentId == e[i].param).length ? `${e[i].param.match('1-') ? `<a onclick="setRec([${par}])" style="position: absolute;transform: translateX(-25px);"><span class="glyphicon glyphicon-pencil"></span></a> ` : '<span style="position: absolute;transform: translateX(-15px);">></span>'}<span class="full" onclick="${full}">${e[i].label}` : `<span class="full" onclick="${full}">${e[i].label}`}<span class="pull-right" style="color:#999">${e[i].code ? e[i].code + ' - ' : ''}${e[i].param}</span></span></li>`
  329. }
  330. $('#recList').append(str)
  331. if (re.rule == 'getOrganizationsAndTagsByUserCategoryRule') {
  332. $('#recList>li').hide()
  333. $('li.1-401,li.4-403,li.3-403,li.2-404').show()
  334. }
  335. }, 'application/json, text/javascript, */*')
  336. }
  337. var getBase = [, { id: '1', rid: '1-401', rule: 'getOrganizationsAndTagsByUserCategoryRule', name: '学校(部门)', rname: '老师' }, , { id: '3', rid: '3-403', rule: 'getOrganizationsAndTagsByUserCategoryRule', rname: '家长', name: '学校(班级)' }, { id: '4', rid: '4-403', rule: 'getOrganizationsAndTagsByUserCategoryRule', rname: '学生', name: '学校(班级)' }]
  338. function setRec(e, ex = 0) {
  339. if (e.length == 0) {
  340. $('#recList').html(oof)
  341. $('#recNav').empty()
  342. }
  343. if (!e[0]) return
  344. $('#recNav').empty()
  345. $('#recNav').append(`<li onclick="setRec([])"><span style="font-size:10px">${getBase[base].id}</span> ${getBase[base].rname}</li>`)
  346. let str = ''
  347. for (let i = 0; i < e.length; i++) {
  348. str += `${i ? ',' : ''}{id:'${e[i].rid || e[i].id}',name:'${e[i].name}',rule:'${e[i].rule}'}`
  349. $('#recNav').append(`<li onclick="setRec([${str}],1)"><span style="font-size:10px">${e[i].rid || e[i].id}</span> ${e[i].name}</li>`)
  350. }
  351. let f = e[e.length - 1]
  352. if (ex) {
  353. $('#recList>li').hide()
  354. $('#recList>li.' + f.id).show()
  355. } else {
  356. getRec(f)
  357. }
  358. }
  359. function toggleWrite() {
  360. $('.boxWrite').is(':visible') ? ($('.box').show(300), $('.boxWrite').hide(300)) : (setTimeout(scrollToBottom, 200), $('.box').hide(300), $('.boxWrite').show(300));
  361. }
  362. function sendMail() {
  363. var fd = new URLSearchParams()
  364. str = ''
  365. for (let i = 0; i < target.length; i++) {
  366. str += ',' + target[i]
  367. }
  368. fd.append('filelist', '[]')
  369. fd.append('mailItemId', '')
  370. fd.append('forwardMailItemId', '')
  371. fd.append('replyMailItemId', '')
  372. fd.append('targetIds', str.slice(1))
  373. fd.append('subject', $('#writeSub').val())
  374. fd.append('files', '')
  375. fd.append('content', $('#writeCt').val())
  376. post('bxn-office/mails/user/sendMail?unwrap=true', fd, e => {
  377. $('#writeBtn>span').removeClass('glyphicon-send').removeClass('glyphicon-exclamation-sign').addClass(e.status == 200 ? 'glyphicon-ok' : 'glyphicon-exclamation-sign'); refreshMail()
  378. })
  379. }
  380. function removeMail(e) {
  381. var fd = new URLSearchParams()
  382. fd.append('checkmail', e)
  383. post('bxn-office/mails/user/removeMail?unwrap=true', fd, refreshMail)
  384. }
  385. $().ready(() => {
  386. $('.e').addClass('reqLogin')
  387. $('.e').removeClass('e')
  388. tryLogin()
  389. $("[data-toggle='tooltip']").tooltip();
  390. $('.recL').hide(300)
  391. $('#recList').html(oof)
  392. $('.banner').text('庆祝数字校园建站 ' + Math.ceil((new Date().getTime() - 1675136714191) / 86400000) + ' 天')
  393. })
  394. oof = `<li onclick="base=1;setRec([getBase[base]])">老师</li><li onclick="base=4;setRec([getBase[base]])">学生</li><li onclick="base=3;setRec([getBase[base]])">家长</li>`
  395. </script>
  396. <style>
  397. .pass {
  398. font-weight: bold;
  399. font-family: 'Courier New', Courier, monospace;
  400. }
  401. li {
  402. border-bottom: 3px solid #eee;
  403. word-wrap: break-word;
  404. }
  405. li:hover {
  406. background-color: #eee;
  407. }
  408. :is(#recList, #recNav)>li {
  409. cursor: pointer;
  410. }
  411. li.endRec {
  412. color: #1a5e93
  413. }
  414. .box {
  415. transition-duration: 300ms;
  416. min-height: 210px;
  417. }
  418. .box::before {
  419. content: '';
  420. display: block;
  421. width: 100%;
  422. height: 3px;
  423. margin-top: 10px;
  424. border-bottom: 1px solid;
  425. border-image: linear-gradient(to right, transparent, #6aaad8, #75ddb6, transparent) 1;
  426. }
  427. .box:hover::before {
  428. border-bottom: 3px solid;
  429. border-image: linear-gradient(to right, transparent, #6aaad8, #75ddb6, transparent) 1;
  430. }
  431. .box:hover {
  432. background-image: linear-gradient(#faffef, transparent);
  433. }
  434. .page-header.nohr {
  435. margin-bottom: 0;
  436. border-bottom: none;
  437. }
  438. .lim {
  439. max-height: 210px;
  440. overflow: auto;
  441. }
  442. .lim:hover {
  443. max-height: 500px;
  444. overflow: auto;
  445. }
  446. .boxMail::-webkit-scrollbar {
  447. width: 5px;
  448. }
  449. .boxMail::-webkit-scrollbar-track {
  450. background-color: transparent;
  451. }
  452. .boxMail::-webkit-scrollbar-thumb {
  453. background-color: transparent;
  454. border-radius: 2px;
  455. }
  456. .boxMail:hover::-webkit-scrollbar-thumb {
  457. background-color: #bbb;
  458. }
  459. .mail,
  460. .mail b {
  461. transition-duration: 300ms;
  462. }
  463. .mail b {
  464. font-weight: 400;
  465. }
  466. .mail.active {
  467. background-image: linear-gradient(to right, #fffaf0, #f4f2ef);
  468. border-left: 3px solid #ccc;
  469. padding-left: 5px;
  470. }
  471. .mail.active b {
  472. font-weight: 700;
  473. font-size: 16px;
  474. }
  475. span.full {
  476. width: 100%;
  477. display: inline-block;
  478. cursor: pointer;
  479. }
  480. .breadcrumb {
  481. padding: 0;
  482. margin-bottom: 5px;
  483. }
  484. .auto-warp {
  485. word-wrap: break-word;
  486. word-break: break-all;
  487. overflow: hidden;
  488. transition-duration: 500ms;
  489. max-height: 22.4px;
  490. }
  491. .auto-warp:hover {
  492. max-height: 100px;
  493. }
  494. </style>
  495. </head>
  496. <body>
  497. <div class="page-header nohr">
  498. <h2><img src="RC.png" width="32px" style="position:relative;top:-4px">
  499. 数字校园
  500. <button class="btn btn-default btn-xs" onclick="$('#detail').toggle(500)">
  501. <span class="glyphicon glyphicon-question-sign"></span>
  502. </button>
  503. </h2>
  504. <span id="loginSt" class="label label-default">未登录</span>
  505. <span id="user" class="label label-default">-</span>
  506. <button class="btn btn-danger btn-xs e" onclick="postLogin()" title="刷新数据">
  507. <span class="glyphicon glyphicon-refresh"></span>
  508. </button>
  509. <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')" title="退出登录">
  510. <span class="glyphicon glyphicon-log-out"></span>
  511. </button>
  512. <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="全部重置">
  513. <span class="glyphicon glyphicon-off"></span>
  514. </button>
  515. <button class="btn btn-danger btn-xs login" onclick="delCookies(2);location.reload()" data-toggle="tooltip" data-placement="right" title="全部重置">
  516. <span class="glyphicon glyphicon-off"></span>
  517. </button>
  518. <img id="avatar" style="position:absolute;right:10px;top:10px;">
  519. </div>
  520. <div id="detail" class="col-sm-12" style="display: none;">
  521. <div class="page-header">
  522. <h3><span class="glyphicon glyphicon-info-sign"></span> 说明
  523. <button class="btn btn-default btn-xs e" onclick="$('#detail').toggle(500);">关闭</button>
  524. </h3>
  525. </div>
  526. 数字校园苦于冗余功能,加载缓慢且对服务器压力大(仅首页就数百个请求),在此简化页面,仅保留必要功能,便于使用。
  527. </div>
  528. <div class="col-md-4 col-sm-6 box">
  529. <div class="page-header">
  530. <h3><span class="glyphicon glyphicon-link"></span> 链接</h3>
  531. </div>
  532. <div class="btn-group" style="margin-bottom: 10px;">
  533. <a id="scoreOld" class="btn btn-default e" target="_blank">心意答</a>
  534. <a class="btn btn-default e" href="/score" target="_blank"><span class="glyphicon glyphicon-stats"></span> 成绩整理</a>
  535. </div>
  536. <div class="btn-group" style="margin-bottom: 10px;">
  537. <a class="btn btn-default e service" target="_blank"><span class="glyphicon glyphicon-tasks"></span> 中台</a>
  538. <a class="btn btn-default e serviceLearn" target="_blank"><span class="glyphicon glyphicon-book"></span> 学习平台</a>
  539. </div>
  540. </div>
  541. <div class="col-md-4 col-sm-6 box">
  542. <div class="page-header">
  543. <h3><span class="glyphicon glyphicon-user"></span> 账号
  544. <ul class="btn-group breadcrumb debug" style="display: none;font-size:10px;top:5px">
  545. <li id="bxn-portal" onclick="get('bxn-portal/portal/osforstudent/index')">bxn-portal</li>
  546. <li id="bxn-core-uic" onclick="get('bxn-core-uic/uic/index')">bxn-core-uic</li>
  547. <li id="bxn-library" onclick="get('bxn-library/library/jumpExamreport?jumpUrl=')">bxn-library</li>
  548. <li id="bxn-office" onclick="get('bxn-office/mail/index')">bxn-office</li>
  549. </ul>
  550. </h3>
  551. </div>
  552. <button class="btn btn-default e" onclick="$('#change').toggle(200)"><span class="glyphicon glyphicon-edit"></span> 修改密码</button>
  553. <button class="btn btn-default e" onclick="$('.debug').toggle(200)">debug</button>
  554. <div class="login">
  555. <br>
  556. <div class="input-group">
  557. <span class="input-group-addon">账号</span>
  558. <input id="loginId" type="id" class="pass form-control" placeholder="20222222">
  559. </div>
  560. <br>
  561. <div class="input-group">
  562. <span class="input-group-addon">密码</span>
  563. <input id="loginPwd" type="password" class="pass form-control" placeholder="password">
  564. <span class="input-group-btn">
  565. <button class="btn btn-default" type="button" onclick="login().then(postLogin)">
  566. <span class="glyphicon glyphicon-log-in"></span> 登录
  567. </button>
  568. </span>
  569. </div>
  570. </div>
  571. <div class="debug" style="display: none;">
  572. <button class="btn btn-default btn-xs" onclick="$('.debugList').empty()"><span class="glyphicon glyphicon-trash"></span> 清除</button>
  573. <ul class="debugList list-unstyled" style="font-family: 'Courier New', Courier, monospace;"></ul>
  574. </div>
  575. <div id="change" style="display: none;">
  576. <br>
  577. <div class="input-group">
  578. <span class="input-group-addon">新密码</span>
  579. <input id="changePwd" type="password" class="pass form-control" placeholder="password" onmouseenter="this.type='id'" onmouseleave="this.type='password'">
  580. <span class="input-group-btn"><button id="changeBtn" class="btn btn-default" type="button" onclick="change()">修改</button></span>
  581. </div>
  582. </div>
  583. </div>
  584. <div class="col-md-4 col-sm-6 box boxMail lim">
  585. <div class="page-header">
  586. <h3><span class="glyphicon glyphicon-envelope"></span> 消息
  587. <button class="btn btn-default btn-xs e" onclick="toggleWrite();">写信</button>
  588. <button class="btn btn-default btn-xs e" onclick="$('.mail-text').hide(300);$('.mail').removeClass('active')">全部收起</button>
  589. <button class="btn btn-default btn-xs e pull-right" onclick="$('.boxMail').toggleClass('col-sm-6').toggleClass('col-md-4').toggleClass('col-sm-12').toggleClass('lim');$('.full-time').toggle();$(this).children().toggleClass('glyphicon-remove').toggleClass('glyphicon-fullscreen')">
  590. <span class="glyphicon glyphicon-fullscreen"></span>
  591. </button>
  592. </h3>
  593. </div>
  594. <ul id="mailList" class="list-unstyled e"></ul>
  595. </div>
  596. <div class="col-sm-12 box boxWrite" style="display: none;">
  597. <div class="page-header">
  598. <h3><span class="glyphicon glyphicon-pencil"></span> 写信
  599. <button class="btn btn-default btn-xs e" onclick="toggleWrite();">关闭</button>
  600. </h3>
  601. </div>
  602. <div class="rec">
  603. 收件人:
  604. <ul id="recSel" class="breadcrumb list-unstyled e" style="display: inline-block;"></ul>
  605. <button class="btn btn-default btn-xs e" onclick="$('.recL').toggle(300,()=>$('#recList').html(oof));$('#recNav').empty();$(this).children().toggleClass('glyphicon-chevron-down')"><span class="glyphicon glyphicon-plus"></span></button>
  606. <div>
  607. <ul id="recNav" class="recL breadcrumb list-unstyled e"></ul>
  608. <ul id="recList" class="recL list-unstyled e"></ul>
  609. </div>
  610. </div>
  611. <br>
  612. <form class="bs-example bs-example-form" role="form">
  613. <div class="col-md-6">
  614. <div class="input-group">
  615. <!-- <span class="input-group-addon"></span> -->
  616. <input id="writeSub" class="form-control" placeholder="标题">
  617. <span class="input-group-btn">
  618. <button id="writeBtn" type="button" class="btn btn-default" onclick="sendMail()" id="chatBtn" style="height: 34px;"><span class="glyphicon glyphicon-send"></span> 发送</button>
  619. </span>
  620. </div>
  621. <textarea id="writeCt" type="text" class="form-control" autocomplete="off" style="resize:vertical;top:-1px;position: relative;" placeholder="内容"></textarea>
  622. </div>
  623. </form>
  624. </div>
  625. <div style="position:fixed;bottom:10px;left:10px;color:#ccc">
  626. 北师大实验中学
  627. </div>
  628. <div style="position:fixed;bottom:10px;right:10px;color:#ccc" class="banner">
  629. 庆祝数字校园建站
  630. </div>
  631. </body>