-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPage.js
66 lines (66 loc) · 2.25 KB
/
Page.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* Created by Administrator on 2014/4/20.
*/
var Page={};
Page.location=String(window.location);
Page.Editor=[];
Page.getDocumentName=function(){
if(this.location.match(/\?(\d{6}_\w+_*\w+)/i))
return this.location.match(/\?(\d{6}_\w+_*\w+)/i)[1];
};
Page.getHashNumber=function(){
if(this.location.match("#"))
return this.location.match(/#(\d+)/i)[1];
};
Page.checkAccout=function(func){
$.ajax({
url: '/Users/AjaxHandler/LoginCheck.aspx',
type: "post",
async: true,
data: "checktype=getinfouser",
error: function (XMLHttpRequest, strError, strObject) {
alert("ajax服务器请求超时!错误详情" + strObject);
return false;
},
success: function (json) {
var arrJson = new Array();
var models = eval("(" + json + ")");
if ( models.UserID > 0) {
$.ajax({
type: "POST",
data: {
name: encodeURI(models.UserName),
url: encodeURI(this.documentName)
},
sync:false,
url: '/subject/edit/login.aspx',
timeout: 20000,
error: function (XMLHttpRequest, strError, strObject) {
Page.returnToLogin();
return false;
},
success: function (response) {
if (response == "True") {
var adminCookie = new GzlCookie("admin");
adminCookie.setCookie("Checked", 30);
func.call();
} else {
$body.text("非指定用户!");
var t = setTimeout("window.location.href ='http://www.gzl.com.cn/error/Error404.html'", 1000);
return false;
}
}
})
} else {
Page.returnToLogin();
return false;
}
}
});
};
Page.clearEditor=function(){
Page.Editor=[];
};
Page.returnToLogin=function (){
window.location.href = "/subject/edit/LoginFail.html";
};