Merge branch 'feature/session' into 'release/5.5.1'
Feature/session See merge request !408
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -25,7 +25,7 @@ module.exports = () => { | @@ -25,7 +25,7 @@ module.exports = () => { | ||
25 | // 不要使用 === 判断uid的值,如果需要判断使用 == | 25 | // 不要使用 === 判断uid的值,如果需要判断使用 == |
26 | let sessionKey = req.cookies._SESSION_KEY && crypto.decrypt('yoho9646abcdefgh', req.cookies._SESSION_KEY); | 26 | let sessionKey = req.cookies._SESSION_KEY && crypto.decrypt('yoho9646abcdefgh', req.cookies._SESSION_KEY); |
27 | 27 | ||
28 | - sessionKey = sessionKey.replace(/\W/g, ''); | 28 | + sessionKey = sessionKey.replace(/[^\w:-]/g, ''); |
29 | req.user.uid = { | 29 | req.user.uid = { |
30 | toString: () => { | 30 | toString: () => { |
31 | return cookie.getUid(req); | 31 | return cookie.getUid(req); |
-
Please register or login to post a comment