Move get url to self referential function
This commit is contained in:
parent
140b239cfc
commit
acdb794971
@ -102,7 +102,19 @@ const getURLVars = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
url: getURLVars(),
|
url: (() => {
|
||||||
|
var v = {};
|
||||||
|
if (location.search.length > 0) {
|
||||||
|
var qs = (location.search.substr(1)).split("&");
|
||||||
|
for (var i = 0; i < qs.length; i++) {
|
||||||
|
var t = qs[i].split("=");
|
||||||
|
if (t[1].length > 0) {
|
||||||
|
v[t[0]] = decodeURIComponent(t[1].replace(/\+/g, '%20'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
})(),
|
||||||
cookie: {
|
cookie: {
|
||||||
set: (name, value, expires, path, domain, secure) => {
|
set: (name, value, expires, path, domain, secure) => {
|
||||||
switch(typeof expires) {
|
switch(typeof expires) {
|
||||||
|
Loading…
Reference in New Issue
Block a user