How to realize automatic logout and login without operation of mouse and keyboard in 5 minutes by web
This article is about how web can log out automatically without mouse and keyboard operation in 5 minutes. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Function ScreenSaver (settings) {
This.settings = settings
This.nTimeout = this.settings.timeout
Document.body.screenSaver = this
/ / link in to body events
Document.body. = ScreenSaver.prototype.onevent
Document.body. = ScreenSaver.prototype.onevent
Document.body.onkeydown = ScreenSaver.prototype.onevent
Document.body.onkeypress = ScreenSaver.prototype.onevent
Var pThis = this
Var f = function () {pThis.timeout ();}
This.timerID = window.setTimeout (f, this.nTimeout)
}
ScreenSaver.prototype.timeout = function () {
If (! this.saver) {
_ window.location ='/ logout'; / / log out of login function
}
}
ScreenSaver.prototype.signal = function () {
If (this.saver) {
This.saver.stop ()
}
Window.clearTimeout (this.timerID)
Var pThis = this
Var f = function () {pThis.timeout ();}
This.timerID = window.setTimeout (f, this.nTimeout)
}
ScreenSaver.prototype.onevent = function (e) {
This.screenSaver.signal ()
}
Var saver
Function initScreenSaver () {
/ / blort
Saver = new ScreenSaver ({timeout:5000})
}
_ window.onload = function () {
InitScreenSaver ()
}
Jump without moving for 5 seconds
Thank you for reading! On "web how to achieve 5-minute mouse and keyboard operation automatic exit login" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!