Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
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
吴学德
gdtel-gztel-school-center
Commits
7079e466
Commit
7079e466
authored
Aug 31, 2021
by
陈浩建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
放号登记接口修改
parent
aee6921c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
apply-net/src/main/java/com/winsun/controller/codeManagerController.java
+28
-0
No files found.
apply-net/src/main/java/com/winsun/controller/codeManagerController.java
View file @
7079e466
...
@@ -98,6 +98,10 @@ public class codeManagerController {
...
@@ -98,6 +98,10 @@ public class codeManagerController {
public
ResponseData
<
Map
<
String
,
Object
>>
checkStudent
(
String
phone
)
{
public
ResponseData
<
Map
<
String
,
Object
>>
checkStudent
(
String
phone
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
phone
.
length
()
!=
11
)
{
map
.
put
(
"code"
,
2
);
return
ResponseData
.
error
(
"手机号码有误,请重新输入"
);
}
try
{
try
{
Wrapper
<
KdPhone
>
wrapper1
=
new
EntityWrapper
<>();
Wrapper
<
KdPhone
>
wrapper1
=
new
EntityWrapper
<>();
wrapper1
.
setSqlSelect
(
"id,phone,tcName"
);
wrapper1
.
setSqlSelect
(
"id,phone,tcName"
);
...
@@ -128,6 +132,30 @@ public class codeManagerController {
...
@@ -128,6 +132,30 @@ public class codeManagerController {
return
ResponseData
.
success
(
map
);
return
ResponseData
.
success
(
map
);
}
}
@ResponseBody
@RequestMapping
(
value
=
"sendCode"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
Map
<
String
,
Object
>>
sendCode
(
String
phone
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
phone
.
length
()
!=
11
)
{
map
.
put
(
"code"
,
2
);
return
ResponseData
.
error
(
"手机号码有误,请重新输入"
);
}
try
{
// 生成6位随机数
int
veCode
=
(
int
)
((
RandomUtil
.
getSecrityRandom
()
*
9
+
1
)
*
100000
);
redisTemplate
.
opsForValue
().
set
(
phone
,
String
.
valueOf
(
veCode
),
30
,
TimeUnit
.
MINUTES
);
saveAuthCodeUtil
.
saveAuthCode
(
phone
,
String
.
valueOf
(
veCode
));
// 临时保存数据库
SendSmsAndMail
.
sendSms
(
phone
,
veCode
+
""
,
"7"
);
log
.
info
(
"验证码:"
+
veCode
);
map
.
put
(
"code"
,
1
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取验证码异常:"
,
e
);
map
.
put
(
"code"
,
2
);
}
return
ResponseData
.
success
(
map
);
}
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"checkCodes"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"checkCodes"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
Map
<
String
,
Object
>>
checkCodes
(
String
phone
,
String
codes
)
{
public
ResponseData
<
Map
<
String
,
Object
>>
checkCodes
(
String
phone
,
String
codes
)
{
...
...
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