Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
周少峰
8 years ago
Commit
946a82f6915a3d89db08879bc2675593fe904179
2 parents
aee8e41c
5e81a5e2
Merge branch 'hotfix/incr-error' into 'master'
fix memcached incr See merge request
!86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
apps/home/router.js
doraemon/middleware/limiter/rules/qps-limit.js
doraemon/views/partial/footer.hbs
apps/home/router.js
View file @
946a82f
...
...
@@ -64,7 +64,7 @@ const homeNav = (req) => {
{
name
:
'我的信息'
,
href
:
'/home/message'
,
count
:
0
},
{
name
:
'在线客服'
,
href
:
_
.
get
(
req
.
app
.
locals
.
pc
,
'clientService.new'
,
false
)
?
'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&
amp;configID=149091&
jid=8732423409'
:
'/service/client'
,
href
:
_
.
get
(
req
.
app
.
locals
.
pc
,
'clientService.new'
,
false
)
?
'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&
configID=149091&
jid=8732423409'
:
'/service/client'
,
isBlank
:
true
}
]
...
...
doraemon/middleware/limiter/rules/qps-limit.js
View file @
946a82f
...
...
@@ -29,8 +29,6 @@ module.exports = (limiter, policy) => {
const
key
=
`
pc
:
limiter
:
$
{
limiter
.
remoteIp
}
`
;
let
isNew
=
true
;
res
.
on
(
'render'
,
function
()
{
let
route
=
req
.
route
?
req
.
route
.
path
:
''
;
let
appPath
=
req
.
app
.
mountpath
;
...
...
@@ -46,15 +44,14 @@ module.exports = (limiter, policy) => {
pageIncr
=
5
;
}
if
(
pageIncr
>
0
&&
!
isNew
)
{
cache
.
incrAsync
(
key
,
pageIncr
);
if
(
pageIncr
>
0
)
{
cache
.
incr
(
key
,
pageIncr
,
(
err
)
=>
{});
}
});
return
cache
.
getAsync
(
key
).
then
((
result
)
=>
{
logger
.
debug
(
'qps limiter: '
+
key
+
'@'
+
result
+
' max: '
+
MAX_QPS
);
if
(
result
&&
_
.
isNumber
(
result
))
{
isNew
=
false
;
if
(
result
===
-
1
)
{
return
Promise
.
resolve
(
true
);
}
...
...
doraemon/views/partial/footer.hbs
View file @
946a82f
...
...
@@ -189,7 +189,7 @@
</div>
<div
class=
"left"
>
<span
class=
"iconfont rgbf"
>

</span>
<a
href=
"
{{#if
@root
.
pc
.
clientService
.
new
}}
http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&
amp;configID=149091&
jid=8732423409
{{else}}
/service/client
{{/if}}
"
target=
"_blank"
>
<a
href=
"
{{#if
@root
.
pc
.
clientService
.
new
}}
http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&
configID=149091&
jid=8732423409
{{else}}
/service/client
{{/if}}
"
target=
"_blank"
>
<span
class=
"red"
>
便捷
</span>
<span
class=
"rgbf"
>
在线客服
</span>
</a>
...
...
Please
register
or
login
to post a comment