-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.js
36 lines (36 loc) · 960 Bytes
/
base.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
function formatDate(t) {//日期格式化
var time = new Date(t);
var year = time.getFullYear();
var month = time.getMonth() + 1;
var date = time.getDate();
var hour = time.getHours();
if (hour < 10) {
hour = '0' + hour;
}
var minute = time.getMinutes();
if (minute < 10) {
minute = '0' + minute;
}
var second = time.getSeconds();
if (second < 10) {
second = '0' + second;
}
return year + "-" + month + "-" + date;
}
function GetRequest() {//获取链接参数
var url = location.search;
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
}
}
return theRequest;
}
/*
var Request = new Object();
Request = GetRequest();
var invite = Request['invite'];
*/