Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
yyq
7 years ago
Commit
21c8c88c3583455fbd7bb6e86c4f6dd10d71c5dc
2 parents
5a90e5b7
fffc4b08
Merge remote-tracking branch 'origin/feature/cookie' into release/0606
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
13 deletions
public/js/common.js
public/js/common.js
View file @
21c8c88
...
...
@@ -23,21 +23,14 @@ let _ChannelVary = {
require
(
'./common/share'
);
function
cookie
(
name
)
{
let
cookies
=
document
.
cookie
,
cookieVal
;
var
re
=
new
RegExp
(
name
+
'=([^;$]*)'
,
'i'
),
matchPattern
=
'$1'
;
if
(
cookies
)
{
cookies
=
cookies
.
split
(
';'
);
for
(
let
i
=
0
;
i
<
cookies
.
length
;
i
++
)
{
if
(
cookies
[
i
].
indexOf
(
name
)
>
-
1
)
{
cookieVal
=
decodeURIComponent
(
$
.
trim
(
cookies
[
i
].
replace
(
name
+
'='
,
''
)));
break
;
}
}
try
{
return
re
.
test
(
decodeURIComponent
(
document
.
cookie
))
?
RegExp
[
matchPattern
]
:
''
;
}
catch
(
e
)
{
return
decodeURIComponent
(
re
.
test
(
document
.
cookie
)
?
RegExp
[
matchPattern
]
:
''
);
}
return
cookieVal
;
}
function
setCookie
(
name
,
value
,
options
)
{
...
...
Please
register
or
login
to post a comment