Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
f9c547a0
Commit
f9c547a0
authored
Sep 09, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addd
parent
a083285b
Pipeline
#13512
passed with stage
in 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
sms.js
app/service/common/sms.js
+1
-1
apply.js
app/service/credit/apply.js
+2
-1
No files found.
app/service/common/sms.js
View file @
f9c547a0
...
@@ -16,7 +16,7 @@ class SmsService extends Service {
...
@@ -16,7 +16,7 @@ class SmsService extends Service {
if
(
!
inputParams
.
hasOwnProperty
(
'phone'
)
||
!
inputParams
.
hasOwnProperty
(
'content'
))
{
if
(
!
inputParams
.
hasOwnProperty
(
'phone'
)
||
!
inputParams
.
hasOwnProperty
(
'content'
))
{
ctx
.
failed
(
'手机号/短信内容不能为空'
);
ctx
.
failed
(
'手机号/短信内容不能为空'
);
}
}
const
url
=
'https://
lan-nginx
.jianbing.com/messages/index'
;
const
url
=
'https://
b
.jianbing.com/messages/index'
;
const
appId
=
'cXeKaF53GQgQk55'
;
const
appId
=
'cXeKaF53GQgQk55'
;
const
appKey
=
'276BC440-B67E-44DA-ADC0-944A79F0DAB0'
;
const
appKey
=
'276BC440-B67E-44DA-ADC0-944A79F0DAB0'
;
let
params
=
{
let
params
=
{
...
...
app/service/credit/apply.js
View file @
f9c547a0
...
@@ -42,10 +42,11 @@ class ApplyService extends Service {
...
@@ -42,10 +42,11 @@ class ApplyService extends Service {
//60秒只能获取一次
//60秒只能获取一次
let
lockKey
=
'mine:credit:black:lock'
+
inputParams
.
phone
;
let
lockKey
=
'mine:credit:black:lock'
+
inputParams
.
phone
;
let
lock
=
app
.
redis
.
get
(
lockKey
);
let
lock
=
app
.
redis
.
get
(
lockKey
);
ctx
.
logger
.
info
(
lock
);
if
(
lock
&&
lock
!==
null
)
{
if
(
lock
&&
lock
!==
null
)
{
ctx
.
failed
(
'获取验证码过于频繁,请稍后再试'
);
ctx
.
failed
(
'获取验证码过于频繁,请稍后再试'
);
}
}
await
app
.
redis
.
set
(
'lock'
,
lockKey
,
'EX'
,
60
);
//60秒锁
await
app
.
redis
.
set
(
'lock'
,
lockKey
,
'EX'
,
5
);
//60秒锁
//每日次数限制
//每日次数限制
let
timesKey
=
'mine:credit:black:times'
+
inputParams
.
phone
;
let
timesKey
=
'mine:credit:black:times'
+
inputParams
.
phone
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment