Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
TDLCloud
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WitCloud
TDLCloud
Commits
bbabec24
Commit
bbabec24
authored
Mar 20, 2020
by
zhuangzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改登录接口
parent
1f0a9cd3
Pipeline
#223
passed with stage
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
33 deletions
+40
-33
build.gradle
build.gradle
+3
-1
UserService.java
src/main/java/com/example/tdl/service/UserService.java
+8
-1
LoginController.java
src/main/java/com/example/tdl/web/LoginController.java
+10
-11
application-docker.properties
src/main/resources/application-docker.properties
+9
-10
application.properties
src/main/resources/application.properties
+10
-10
No files found.
build.gradle
View file @
bbabec24
...
...
@@ -19,7 +19,9 @@ version = '0.0.1-SNAPSHOT'
sourceCompatibility
=
1.8
repositories
{
mavenCentral
()
maven
{
url
'https://maven.aliyun.com/repository/public/'
}
mavenLocal
()
mavenCentral
()
}
...
...
src/main/java/com/example/tdl/service/UserService.java
View file @
bbabec24
...
...
@@ -83,7 +83,14 @@ public class UserService {
return
null
;
}
String
token
=
DigestUtils
.
md5Hex
(
System
.
currentTimeMillis
()
+
userVo
.
getUserName
());
UserRedisVo
redisVo
=
new
UserRedisVo
(
userVo
.
getUserName
(),
userVo
.
getUserNumber
(),
userVo
.
getNickName
(),
userVo
.
getEmail
(),
userVo
.
getPhone
(),
userVo
.
getRoleName
(),
userVo
.
getCompanyNo
(),
userVo
.
getCompanyName
());
UserRedisVo
redisVo
=
new
UserRedisVo
(
userVo
.
getUserName
(),
userVo
.
getUserNumber
(),
userVo
.
getNickName
(),
userVo
.
getEmail
(),
userVo
.
getPhone
(),
userVo
.
getRoleName
(),
userVo
.
getCompanyName
(),
userVo
.
getCompanyNo
());
//将用户数据保存到redis中
redisService
.
set
(
"TOKEN_"
+
token
,
gson
.
toJson
(
redisVo
),
60
*
30
);
return
token
;
...
...
src/main/java/com/example/tdl/web/LoginController.java
View file @
bbabec24
...
...
@@ -70,21 +70,20 @@ public class LoginController {
return
gson
.
toJson
(
fb
);
}
try
{
UserVo
userVo
=
userService
.
getByUserName
(
loginUserVo
.
getUserName
());
//生成token
String
token
=
DigestUtils
.
md5Hex
(
System
.
currentTimeMillis
()
+
userVo
.
getUserName
());
UserRedisVo
redisVo
=
new
UserRedisVo
(
userVo
.
getUserName
(),
userVo
.
getUserNumber
(),
userVo
.
getNickName
(),
userVo
.
getEmail
(),
userVo
.
getPhone
(),
userVo
.
getRoleName
(),
userVo
.
getCompanyName
(),
userVo
.
getCompanyNo
());
//将用户数据保存到redis中
userTokenService
.
setHash
(
userVo
.
getUserNumber
(),
"TOKEN_"
+
token
,
System
.
currentTimeMillis
()+
""
,
60
*
60
*
24
);
tokenRedisService
.
set
(
"TOKEN_"
+
token
,
gson
.
toJson
(
redisVo
),
60
*
30
);
String
token
=
userService
.
getUser
(
loginUserVo
);
if
(
token
==
null
){
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"login"
));
return
gson
.
toJson
(
fb
);
}
String
ip
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
().
getRemoteAddr
();
int
a
=
loginLogService
.
addLoginLog
(
new
LoginLog
(
loginUserVo
.
getUserName
(),
System
.
currentTimeMillis
(),
ip
));
if
(
a
>
0
)
{
int
a
=
loginLogService
.
addLoginLog
(
new
LoginLog
(
loginUserVo
.
getUserName
(),
System
.
currentTimeMillis
(),
ip
));
if
(
a
>
0
)
{
fb
.
setCode
(
1
);
fb
.
setMessage
(
token
);
}
else
{
}
else
{
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"addLogFailure"
));
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"addLogFailure"
));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
src/main/resources/application-docker.properties
View file @
bbabec24
...
...
@@ -4,7 +4,6 @@ spring.datasource.username=witcloud
spring.datasource.password
=
Witcloud37774020
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
tdl.core.add
=
http://warehouse-herocore:8079/witium/addMount
tdl.core.delete
=
http://warehouse-herocore:8079/witium/delMount
...
...
@@ -15,15 +14,15 @@ tdl.redis.password=Witium37774020
server.port
=
8092
# InfluxDB
spring.influxdb.url
=
https://ts-bp1q738i505oj79t7.influxdata.tsdb.aliyuncs.com:8086
spring.influxdb.username
=
witcloud
spring.influxdb.password
=
Witcloud37774020
spring.influxdb.database
=
warehouse_bosch
#
spring.influxdb.url=http://witcloud-influxdb:8086
#
spring.influxdb.username=admin
#
spring.influxdb.password=37774020
#
spring.influxdb.database=original
#
spring.influxdb.url=https://ts-bp1q738i505oj79t7.influxdata.tsdb.aliyuncs.com:8086
#
spring.influxdb.username=witcloud
#
spring.influxdb.password=Witcloud37774020
#
spring.influxdb.database=warehouse_bosch
spring.influxdb.url
=
http://witcloud-influxdb:8086
spring.influxdb.username
=
admin
spring.influxdb.password
=
37774020
spring.influxdb.database
=
original
# MQTT (Aliyun local IP address)
tdl.mqtt.url
=
ssl://192.168.1.124
...
...
src/main/resources/application.properties
View file @
bbabec24
...
...
@@ -7,7 +7,7 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver
threadpool.corepoolsize
=
30
threadpool.maxpoolsize
=
50
server.port
=
809
2
server.port
=
809
9
management.security.enabled
=
false
...
...
@@ -51,15 +51,15 @@ tdl.mqtt.clientpwd =
# InfluxDB
spring.influxdb.username
=
witcloud
spring.influxdb.password
=
Witcloud37774020
spring.influxdb.url
=
https://ts-bp1q738i505oj79t7.influxdata.rds.aliyuncs.com:3242
spring.influxdb.database
=
logistics
#
spring.influxdb.url=http://47.97.184.225:8086
#
spring.influxdb.username=admin
#
spring.influxdb.password=37774020
#
spring.influxdb.database=original
#
spring.influxdb.username=witcloud
#
spring.influxdb.password=Witcloud37774020
#
spring.influxdb.url=https://ts-bp1q738i505oj79t7.influxdata.rds.aliyuncs.com:3242
#
spring.influxdb.database=logistics
spring.influxdb.url
=
http://47.97.184.225:8086
spring.influxdb.username
=
admin
spring.influxdb.password
=
37774020
spring.influxdb.database
=
original
spring.influxdb.retentionPolicy
=
tdl_policy
spring.influxdb.connent-timeout
=
10
spring.influxdb.read-timeout
=
30
...
...
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