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
bfd26b2d
Commit
bfd26b2d
authored
Jun 11, 2022
by
伍思炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复redis问题
parent
d423d718
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
apply-net/src/main/java/com/winsun/controller/codeManagerController.java
+6
-2
No files found.
apply-net/src/main/java/com/winsun/controller/codeManagerController.java
View file @
bfd26b2d
...
@@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
...
@@ -59,7 +60,7 @@ public class codeManagerController extends BaseController {
...
@@ -59,7 +60,7 @@ public class codeManagerController extends BaseController {
@Autowired
@Autowired
private
AuthCodeMapper
authCodeMapper
;
private
AuthCodeMapper
authCodeMapper
;
@Autowired
@Autowired
@Qualifier
(
"redisStringTemplate"
)
//
@Qualifier("redisStringTemplate")
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
@Autowired
private
ProductMapper
productMapper
;
private
ProductMapper
productMapper
;
...
@@ -75,6 +76,9 @@ public class codeManagerController extends BaseController {
...
@@ -75,6 +76,9 @@ public class codeManagerController extends BaseController {
@Autowired
@Autowired
private
SaveAuthCodeUtil
saveAuthCodeUtil
;
private
SaveAuthCodeUtil
saveAuthCodeUtil
;
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
private
static
String
PATH1
=
"StudentCard1"
;
private
static
String
PATH1
=
"StudentCard1"
;
private
static
String
PATH2
=
"StudentCard2"
;
private
static
String
PATH2
=
"StudentCard2"
;
...
@@ -164,7 +168,7 @@ public class codeManagerController extends BaseController {
...
@@ -164,7 +168,7 @@ public class codeManagerController extends BaseController {
try
{
try
{
// 生成6位随机数
// 生成6位随机数
int
veCode
=
(
int
)
((
RandomUtil
.
getSecrityRandom
()
*
9
+
1
)
*
100000
);
int
veCode
=
(
int
)
((
RandomUtil
.
getSecrityRandom
()
*
9
+
1
)
*
100000
);
r
edisTemplate
.
opsForValue
().
set
(
phone
,
String
.
valueOf
(
veCode
),
30
,
TimeUnit
.
MINUTES
);
stringR
edisTemplate
.
opsForValue
().
set
(
phone
,
String
.
valueOf
(
veCode
),
30
,
TimeUnit
.
MINUTES
);
saveAuthCodeUtil
.
saveAuthCode
(
phone
,
String
.
valueOf
(
veCode
));
// 临时保存数据库
saveAuthCodeUtil
.
saveAuthCode
(
phone
,
String
.
valueOf
(
veCode
));
// 临时保存数据库
SendSmsAndMail
.
sendSms
(
phone
,
veCode
+
""
,
null
,
"7"
);
SendSmsAndMail
.
sendSms
(
phone
,
veCode
+
""
,
null
,
"7"
);
log
.
info
(
"验证码:"
+
veCode
);
log
.
info
(
"验证码:"
+
veCode
);
...
...
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