Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
34f2ae67
Commit
34f2ae67
authored
Nov 25, 2019
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
77b289c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
laowubao/app/base/api/impl/operator/laoActionApi.js
+8
-3
No files found.
laowubao/app/base/api/impl/operator/laoActionApi.js
View file @
34f2ae67
...
...
@@ -13,6 +13,7 @@ class LaoActionApi extends APIBase {
// this.restClient = system.getObject("util.restClient");
this
.
smsClient
=
system
.
getObject
(
"util.smsClient"
);
this
.
vcodePrev
=
"lwb_vcode_"
;
this
.
testPhones
=
[
'13691046554'
,
'13333333333'
];
}
async
test
(
pobj
,
query
)
{
...
...
@@ -74,16 +75,20 @@ class LaoActionApi extends APIBase {
if
(
!
/^1
[
23456789
]\d{9}
$/
.
test
(
phone_no
))
{
return
system
.
getResult
(
null
,
"手机号码格式不正确"
);
}
var
isTest
=
this
.
testPhones
.
indexOf
(
phone_no
)
!=
-
1
;
// 生成验证码
var
key
=
this
.
vcodePrev
+
phone_no
;
var
vcode
=
await
this
.
redisClient
.
get
(
key
+
"t"
);
if
(
!
vcode
)
{
vcode
=
await
this
.
getVCode
();
vcode
=
isTest
?
"123123"
:
await
this
.
getVCode
();
await
this
.
redisClient
.
setWithEx
(
key
,
vcode
,
5
*
60
);
await
this
.
redisClient
.
setWithEx
(
key
+
"t"
,
vcode
,
60
);
var
msg
=
"您的验证码为"
+
vcode
+
", (切勿将验证码告知别人, 请在5分钟内输入完成验证, 如有问题请联系客服。)"
;
var
rs
=
await
this
.
smsClient
.
sendMsg
(
phone_no
,
msg
);
console
.
log
(
rs
);
if
(
!
isTest
)
{
var
rs
=
await
this
.
smsClient
.
sendMsg
(
phone_no
,
msg
);
console
.
log
(
rs
);
}
}
return
system
.
getResultSuccess
(
"发送成功"
);
}
catch
(
error
)
{
...
...
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