Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
5da3ef54
Commit
5da3ef54
authored
Aug 10, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 小程序手机号格式校验
parent
aedca6c6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
+3
-3
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
View file @
5da3ef54
...
@@ -168,9 +168,6 @@ public class UserServiceImpl implements UserService {
...
@@ -168,9 +168,6 @@ public class UserServiceImpl implements UserService {
@Override
@Override
public
Result
regCaptcha
(
UserRequestDto
dto
)
{
public
Result
regCaptcha
(
UserRequestDto
dto
)
{
try
{
try
{
if
(!
RegexUtil
.
isMobileExact
(
dto
.
getMobile
()))
{
return
Result
.
failed
(
"手机号格式不正确"
);
}
if
(!
notifyService
.
isSmsEnable
())
{
if
(!
notifyService
.
isSmsEnable
())
{
logger
.
error
(
"请求验证码出错:{}"
,
WxResponseCode
.
AUTH_CAPTCHA_UNSUPPORT
.
desc
());
logger
.
error
(
"请求验证码出错:{}"
,
WxResponseCode
.
AUTH_CAPTCHA_UNSUPPORT
.
desc
());
return
Result
.
failed
(
WxResponseCode
.
AUTH_CAPTCHA_UNSUPPORT
.
desc
());
return
Result
.
failed
(
WxResponseCode
.
AUTH_CAPTCHA_UNSUPPORT
.
desc
());
...
@@ -178,6 +175,9 @@ public class UserServiceImpl implements UserService {
...
@@ -178,6 +175,9 @@ public class UserServiceImpl implements UserService {
String
activeProfile
=
applicationContext
.
getEnvironment
().
getActiveProfiles
()[
0
];
String
activeProfile
=
applicationContext
.
getEnvironment
().
getActiveProfiles
()[
0
];
String
code
=
"123456"
;
String
code
=
"123456"
;
if
(!
StringUtils
.
equals
(
"dev"
,
activeProfile
))
{
if
(!
StringUtils
.
equals
(
"dev"
,
activeProfile
))
{
if
(!
RegexUtil
.
isMobileExact
(
dto
.
getMobile
()))
{
return
Result
.
failed
(
"手机号格式不正确"
);
}
code
=
CharUtil
.
getRandomNum
(
6
);
code
=
CharUtil
.
getRandomNum
(
6
);
SmsResult
smsResult
=
notifyService
.
notifySmsTemplate
(
dto
.
getMobile
(),
NotifyType
.
CAPTCHA
,
new
String
[]{
code
,
"1"
});
SmsResult
smsResult
=
notifyService
.
notifySmsTemplate
(
dto
.
getMobile
(),
NotifyType
.
CAPTCHA
,
new
String
[]{
code
,
"1"
});
if
(
smsResult
!=
null
)
{
if
(
smsResult
!=
null
)
{
...
...
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