Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
HaiNaAIFaceToFace
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
霍传世
HaiNaAIFaceToFace
Commits
87b12ab1
Commit
87b12ab1
authored
Jan 15, 2025
by
霍传世
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HaiNaAi测试小程序
parent
30033500
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
src/main/java/com/yuda/hainafacetofaceai/controller/LoginController.java
...om/yuda/hainafacetofaceai/controller/LoginController.java
+9
-4
src/main/resources/application.properties
src/main/resources/application.properties
+4
-0
No files found.
src/main/java/com/yuda/hainafacetofaceai/controller/LoginController.java
View file @
87b12ab1
...
@@ -3,7 +3,6 @@ package com.yuda.hainafacetofaceai.controller;
...
@@ -3,7 +3,6 @@ package com.yuda.hainafacetofaceai.controller;
import
com.yuda.hainafacetofaceai.entity.ExamStudent
;
import
com.yuda.hainafacetofaceai.entity.ExamStudent
;
import
com.yuda.hainafacetofaceai.util.AppUtil
;
import
com.yuda.hainafacetofaceai.util.AppUtil
;
import
org.apache.tomcat.util.security.MD5Encoder
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
...
@@ -13,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -13,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.sql.Time
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
@RestController
@RestController
...
@@ -30,8 +28,15 @@ public class LoginController {
...
@@ -30,8 +28,15 @@ public class LoginController {
public
ResponseEntity
LoginGo
(
@RequestBody
ExamStudent
examStudent
){
public
ResponseEntity
LoginGo
(
@RequestBody
ExamStudent
examStudent
){
if
(
examStudent
.
getZkzNum
().
equals
(
"9053464144"
)&&
examStudent
.
getIdCard
().
equals
(
"039519938378128944"
)){
if
(
examStudent
.
getZkzNum
().
equals
(
"9053464144"
)&&
examStudent
.
getIdCard
().
equals
(
"039519938378128944"
)){
redisTemplate
.
opsForValue
().
set
(
"51096606163"
,
new
JSONObject
(
examStudent
).
toString
(),
2
*
60
*
60
,
TimeUnit
.
SECONDS
);
redisTemplate
.
opsForValue
().
set
(
"51096606163"
,
new
JSONObject
(
examStudent
).
toString
(),
2
*
60
*
60
,
TimeUnit
.
SECONDS
);
return
ResponseEntity
.
ok
(
"51096606163"
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"Token"
,
"51096606163"
);
jsonObject
.
put
(
"code"
,
200
);
jsonObject
.
put
(
"message"
,
"登录成功"
);
return
ResponseEntity
.
ok
(
jsonObject
.
toString
());
}
}
return
ResponseEntity
.
badRequest
().
body
(
"账号密码错误"
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"code"
,
500
);
jsonObject
.
put
(
"message"
,
"账号密码错误"
);
return
ResponseEntity
.
badRequest
().
body
(
jsonObject
.
toString
());
}
}
}
}
src/main/resources/application.properties
View file @
87b12ab1
...
@@ -4,4 +4,8 @@ spring.redis.host=10.0.0.16
...
@@ -4,4 +4,8 @@ spring.redis.host=10.0.0.16
spring.redis.port
=
6379
spring.redis.port
=
6379
spring.redis.password
=
Camp@Redis2023
spring.redis.password
=
Camp@Redis2023
spring.redis.database
=
51
spring.redis.database
=
51
#spring.redis.host=127.0.0.1
#spring.redis.port=6379
#spring.redis.password=
#spring.redis.database=1
spring.redis.timeout
=
2000
spring.redis.timeout
=
2000
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