行 1:
行 1:
+
{{Infobox system
+
| name=校務行政系統
+
| image=<imgur width="100%">8QuMtKh</imgur>
+
| creator=亞昕資訊股份有限公司
+
| first_release=2020年
+
| source=不開源(似乎)
+
| version=未知
+
| devlang=C++、C# (ASP.NET)
+
| env=Chrome
+
| license=All Rights Reserved
+
}}
史上最慢的系統
史上最慢的系統
[https://cysh-cy.k12ea.gov.tw/SCH_UI/ 坐火箭前往車站搭蝸牛]
[https://cysh-cy.k12ea.gov.tw/SCH_UI/ 坐火箭前往車站搭蝸牛]
+
+
= 更新 =
+
系統於2024/7/21更新,加上可更改密碼的功能。
+
+
+
= 工程師版本(外掛版) =
+
幫你修正讓這個系統更好用一點,選自己喜歡的用,'''不是廣告'''!!!
+
== KnowScratcher - Better CYSH System ==
+
[https://github.com/KnowScratcher/Better-CYSH-System KnowScratcher - Better CYSH System]
= 技術紀載 =
= 技術紀載 =
+
== 沒有破解做不到 ==
+
# 使用外部圖片
+
# 連接外部網站
+
# 使用外部檔案
+
== JQuery版本 ==
+
3.6.1
+
== CSP ==
+
<pre>
+
default-src 'self';
+
connect-src 'self';
+
font-src 'self' data:;
+
frame-src 'self' blob: data:;
+
img-src 'self' blob: data:;
+
media-src 'self';
+
object-src 'self' blob: data:;
+
script-src 'self' blob: data: 'unsafe-inline' 'unsafe-eval' https://accounts.google.com/;
+
style-src 'self' 'unsafe-inline';
+
frame-ancestors 'self' ;
+
</pre>
+
== 平均載入時間==
== 平均載入時間==
3.5秒
3.5秒
行 18:
行 58:
event listener: ASLoadProgress.js
event listener: ASLoadProgress.js
<syntaxhighlight lang="javascript" line start="237">
<syntaxhighlight lang="javascript" line start="237">
+
235|window.onmousemove = resetTimer;
+
236|window.onkeypress = resetTimer;
237|window.addEventListener("compositionupdate", resetTimer);
237|window.addEventListener("compositionupdate", resetTimer);
</syntaxhighlight>
</syntaxhighlight>
行 48:
行 90:
=== 登出方法 ===
=== 登出方法 ===
轉網址至Login.aspx即可登出
轉網址至Login.aspx即可登出
+
+
=== 完整相關程式碼 ===
+
<syntaxhighlight lang="javascript" line start="230">
+
230|function inactivityTime() {
+
231| var ast;
+
232| var aspostback = new Date();
+
233| //window.onload = resetTimer;
+
234| // DOM Events
+
235| window.onmousemove = resetTimer;
+
236| window.onkeypress = resetTimer;
+
237| window.addEventListener("compositionupdate", resetTimer);
+
238| //window.onmousedown = resetTimer; // catches touchscreen presses
+
239| //window.onclick = resetTimer; // catches touchpad clicks
+
240| //window.onscroll = resetTimer; // catches scrolling with arrow keys
+
241| resetTimer;
+
242|
+
243| function logout() {
+
244| //alert("閒置時間過久,請重新登入");
+
245| //window.location = "Login.aspx";
+
246| var pagename = "Login.aspx";
+
247| var arrPath = location.pathname.split('/');
+
248| if (arrPath.length > 0) {
+
249| if (arrPath[arrPath.length - 1].toLowerCase().indexOf('.aspx') > -1) {
+
250| pagename = arrPath[arrPath.length - 1].toLowerCase();
+
251| }
+
252| }
+
253| if (pagename.toUpperCase() != "LOGIN.ASPX") {
+
254| var asrelogintag;
+
255| var asreloginoutframe = window.top.document.getElementsByTagName('iframe');
+
256| while(asreloginoutframe.length > 0){
+
257| var ifinalframe = 0;
+
258| for(var ipopc = 0; ipopc < asreloginoutframe.length; ipopc++){
+
259| var poptmp = asreloginoutframe[ipopc].contentWindow.document.getElementById('asrelogin');
+
260| if(poptmp){
+
261| asrelogintag = poptmp;
+
262| break;
+
263| }
+
264| if(asreloginoutframe[ipopc].id == 'iframecontent'){
+
265| ifinalframe = ipopc;
+
266| }
+
267| }
+
268| asframetmp = asreloginoutframe[ifinalframe].contentWindow.document.getElementsByTagName('iframe');
+
269| asreloginoutframe = asframetmp;
+
270| }
+
271| var basrelogin = false;
+
272| if(window.top.document.getElementById('ReLogin_div')){
+
273| basrelogin = true;
+
274| }else{
+
275| asreloginoutframe = window.top.document.getElementsByTagName('iframe');
+
276| while(asreloginoutframe.length > 0){
+
277| var ifinalframe = 0;
+
278| for(var ipopc = 0; ipopc < asreloginoutframe.length; ipopc++){
+
279| var poptmp = asreloginoutframe[ipopc].contentWindow.document.getElementById('ReLogin_div');
+
280| if(poptmp){
+
281| basrelogin = true;
+
282| break;
+
283| }
+
284| if(asreloginoutframe[ipopc].id == 'iframecontent'){
+
285| ifinalframe = ipopc;
+
286| }
+
287| }
+
288| asframetmp = asreloginoutframe[ifinalframe].contentWindow.document.getElementsByTagName('iframe');
+
289| asreloginoutframe = asframetmp;
+
290| }
+
291| }
+
292|
+
293| if (asrelogintag) {
+
294| if(!basrelogin){
+
295| var asreloginchk;
+
296| var website = location.href;
+
297| website = website.substring(0, website.lastIndexOf('/') + 1);
+
298| try {
+
299| var asreloginclient = getXmlHttpRequestObject();
+
300| asreloginclient.onreadystatechange = function () {
+
301| if (asreloginclient.readyState == 4 && asreloginclient.status == 200) {
+
302| asreloginchk = asreloginclient.getResponseHeader("asui");
+
303| }
+
304| }
+
305| asreloginclient.open("GET", encodeURI(website + "AsCheck.ashx"), false);
+
306| asreloginclient.send();
+
307| }
+
308| catch (e) {
+
309| }
+
310|
+
311| if(!asreloginchk){
+
312| //ReloginWindow();
+
313| }
+
314| }
+
315| }
+
316| else {
+
317| alert("閒置時間過久,請重新登入");
+
318| window.top.location = "../Login.aspx";
+
319| }
+
320| }
+
321| }
+
322|
+
323| function resetTimer() {
+
324| console.log("resetTimer");
+
325| window.top.clearTimeout(ast);
+
326| var sessionTimeoutWarning = 20; //min
+
327| var sTimeout = parseInt(sessionTimeoutWarning) * 60 * 1000;
+
328| ast = window.top.setTimeout(logout, sTimeout);
+
329| var current = new Date();
+
330| if (((current.getTime() - aspostback.getTime())/60000)>15)
+
331| {
+
332| try {
+
333| var astimerclient = getXmlHttpRequestObject();
+
334| astimerclient.open("GET", encodeURI("AsCheck.ashx"), false);
+
335| astimerclient.send();
+
336| }
+
337| catch (e) {
+
338| }
+
339| aspostback = new Date();
+
340| console.log("AsCheck");
+
341| }
+
342| // 1000 milisec = 1 sec
+
343| }
+
344|};
+
+
</syntaxhighlight>
== 隱藏物件 ==
== 隱藏物件 ==
行 66:
行 228:
<code>#divprivacy_outer_id</code>
<code>#divprivacy_outer_id</code>
−
== 好笑的 ==
+
== iframe位置 ==
−
# 這個系統沒有用jquery,全部硬幹
+
所有第三層頁面
+
+
== 好想吐血 ==
+
# 這個系統引進jquery,但還是有很多時候是原始方法硬幹
# Javascript都亂放,一下放html裡一下放js檔案
# Javascript都亂放,一下放html裡一下放js檔案
# 等server回應真的TMD久
# 等server回應真的TMD久
+
# 頭像是用fixed的方式定位
+
# 該flex的地方不flex,不該flex的地方flex
+
# 一下用css指定style一下用element.style
[[Category:嘉中系統]]
[[Category:嘉中系統]]
[[Category:給工程師]]
[[Category:給工程師]]