Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
ecb2cbe9
Commit
ecb2cbe9
authored
Jan 12, 2020
by
Junling Bu
Browse files
fix[litemall-wx-api]: 验证码未超时仍会发送验证码
parent
1bc2f4e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java
View file @
ecb2cbe9
...
...
@@ -197,12 +197,11 @@ public class WxAuthController {
return
ResponseUtil
.
fail
(
AUTH_CAPTCHA_UNSUPPORT
,
"小程序后台验证码服务不支持"
);
}
String
code
=
CharUtil
.
getRandomNum
(
6
);
notifyService
.
notifySmsTemplate
(
phoneNumber
,
NotifyType
.
CAPTCHA
,
new
String
[]{
code
});
boolean
successful
=
CaptchaCodeManager
.
addToCache
(
phoneNumber
,
code
);
if
(!
successful
)
{
return
ResponseUtil
.
fail
(
AUTH_CAPTCHA_FREQUENCY
,
"验证码未超时1分钟,不能发送"
);
}
notifyService
.
notifySmsTemplate
(
phoneNumber
,
NotifyType
.
CAPTCHA
,
new
String
[]{
code
});
return
ResponseUtil
.
ok
();
}
...
...
@@ -355,14 +354,11 @@ public class WxAuthController {
return
ResponseUtil
.
fail
(
AUTH_CAPTCHA_UNSUPPORT
,
"小程序后台验证码服务不支持"
);
}
String
code
=
CharUtil
.
getRandomNum
(
6
);
// TODO
// 根据type发送不同的验证码
notifyService
.
notifySmsTemplate
(
phoneNumber
,
NotifyType
.
CAPTCHA
,
new
String
[]{
code
});
boolean
successful
=
CaptchaCodeManager
.
addToCache
(
phoneNumber
,
code
);
if
(!
successful
)
{
return
ResponseUtil
.
fail
(
AUTH_CAPTCHA_FREQUENCY
,
"验证码未超时1分钟,不能发送"
);
}
notifyService
.
notifySmsTemplate
(
phoneNumber
,
NotifyType
.
CAPTCHA
,
new
String
[]{
code
});
return
ResponseUtil
.
ok
();
}
...
...
Write
Preview
Supports
Markdown
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