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
fea1a14f
Commit
fea1a14f
authored
Jun 09, 2020
by
Carit Zhu
🎱
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tdl_bosch' into tdl_bosch_carit
# Conflicts: # src/main/resources/application.properties
parents
ec5332a9
bbabec24
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
36 deletions
+42
-36
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
+12
-13
No files found.
build.gradle
View file @
fea1a14f
...
@@ -19,7 +19,9 @@ version = '0.0.1-SNAPSHOT'
...
@@ -19,7 +19,9 @@ version = '0.0.1-SNAPSHOT'
sourceCompatibility
=
1.8
sourceCompatibility
=
1.8
repositories
{
repositories
{
mavenCentral
()
maven
{
url
'https://maven.aliyun.com/repository/public/'
}
mavenLocal
()
mavenCentral
()
}
}
...
...
src/main/java/com/example/tdl/service/UserService.java
View file @
fea1a14f
...
@@ -83,7 +83,14 @@ public class UserService {
...
@@ -83,7 +83,14 @@ public class UserService {
return
null
;
return
null
;
}
}
String
token
=
DigestUtils
.
md5Hex
(
System
.
currentTimeMillis
()
+
userVo
.
getUserName
());
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中
//将用户数据保存到redis中
redisService
.
set
(
"TOKEN_"
+
token
,
gson
.
toJson
(
redisVo
),
60
*
30
);
redisService
.
set
(
"TOKEN_"
+
token
,
gson
.
toJson
(
redisVo
),
60
*
30
);
return
token
;
return
token
;
...
...
src/main/java/com/example/tdl/web/LoginController.java
View file @
fea1a14f
...
@@ -70,21 +70,20 @@ public class LoginController {
...
@@ -70,21 +70,20 @@ public class LoginController {
return
gson
.
toJson
(
fb
);
return
gson
.
toJson
(
fb
);
}
}
try
{
try
{
UserVo
userVo
=
userService
.
getByUserName
(
loginUserVo
.
getUserName
());
String
token
=
userService
.
getUser
(
loginUserVo
);
//生成token
if
(
token
==
null
){
String
token
=
DigestUtils
.
md5Hex
(
System
.
currentTimeMillis
()
+
userVo
.
getUserName
());
fb
.
setCode
(
0
);
UserRedisVo
redisVo
=
new
UserRedisVo
(
userVo
.
getUserName
(),
userVo
.
getUserNumber
(),
userVo
.
getNickName
(),
userVo
.
getEmail
(),
userVo
.
getPhone
(),
userVo
.
getRoleName
(),
userVo
.
getCompanyName
(),
userVo
.
getCompanyNo
());
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"login"
));
//将用户数据保存到redis中
return
gson
.
toJson
(
fb
);
userTokenService
.
setHash
(
userVo
.
getUserNumber
(),
"TOKEN_"
+
token
,
System
.
currentTimeMillis
()+
""
,
60
*
60
*
24
);
}
tokenRedisService
.
set
(
"TOKEN_"
+
token
,
gson
.
toJson
(
redisVo
),
60
*
30
);
String
ip
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
().
getRemoteAddr
();
String
ip
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
().
getRemoteAddr
();
int
a
=
loginLogService
.
addLoginLog
(
new
LoginLog
(
loginUserVo
.
getUserName
(),
System
.
currentTimeMillis
(),
ip
));
int
a
=
loginLogService
.
addLoginLog
(
new
LoginLog
(
loginUserVo
.
getUserName
(),
System
.
currentTimeMillis
(),
ip
));
if
(
a
>
0
)
{
if
(
a
>
0
)
{
fb
.
setCode
(
1
);
fb
.
setCode
(
1
);
fb
.
setMessage
(
token
);
fb
.
setMessage
(
token
);
}
else
{
}
else
{
fb
.
setCode
(
0
);
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"addLogFailure"
));
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"addLogFailure"
));
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
src/main/resources/application-docker.properties
View file @
fea1a14f
...
@@ -4,7 +4,6 @@ spring.datasource.username=witcloud
...
@@ -4,7 +4,6 @@ spring.datasource.username=witcloud
spring.datasource.password
=
Witcloud37774020
spring.datasource.password
=
Witcloud37774020
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
tdl.core.add
=
http://warehouse-herocore:8079/witium/addMount
tdl.core.add
=
http://warehouse-herocore:8079/witium/addMount
tdl.core.delete
=
http://warehouse-herocore:8079/witium/delMount
tdl.core.delete
=
http://warehouse-herocore:8079/witium/delMount
...
@@ -15,15 +14,15 @@ tdl.redis.password=Witium37774020
...
@@ -15,15 +14,15 @@ tdl.redis.password=Witium37774020
server.port
=
8092
server.port
=
8092
# InfluxDB
# InfluxDB
spring.influxdb.url
=
https://ts-bp1q738i505oj79t7.influxdata.tsdb.aliyuncs.com:8086
#
spring.influxdb.url=https://ts-bp1q738i505oj79t7.influxdata.tsdb.aliyuncs.com:8086
spring.influxdb.username
=
witcloud
#
spring.influxdb.username=witcloud
spring.influxdb.password
=
Witcloud37774020
#
spring.influxdb.password=Witcloud37774020
spring.influxdb.database
=
warehouse_bosch
#
spring.influxdb.database=warehouse_bosch
#
spring.influxdb.url=http://witcloud-influxdb:8086
spring.influxdb.url
=
http://witcloud-influxdb:8086
#
spring.influxdb.username=admin
spring.influxdb.username
=
admin
#
spring.influxdb.password=37774020
spring.influxdb.password
=
37774020
#
spring.influxdb.database=original
spring.influxdb.database
=
original
# MQTT (Aliyun local IP address)
# MQTT (Aliyun local IP address)
tdl.mqtt.url
=
ssl://192.168.1.124
tdl.mqtt.url
=
ssl://192.168.1.124
...
...
src/main/resources/application.properties
View file @
fea1a14f
...
@@ -39,11 +39,10 @@ logging.config=classpath:logback.xml
...
@@ -39,11 +39,10 @@ logging.config=classpath:logback.xml
# Mqtt
# Mqtt
#tdl.mqtt.url = ssl://172.16.1.24
tdl.mqtt.url
=
ssl://172.16.1.24
tdl.mqtt.url
=
ssl://47.96.128.181
tdl.mqtt.port
=
8883
tdl.mqtt.port
=
8883
tdl.mqtt.username
=
logistics
tdl.mqtt.username
=
ugen
tdl.mqtt.password
=
logistics37774020
tdl.mqtt.password
=
ugen
tdl.mqtt.qos
=
1
tdl.mqtt.qos
=
1
tdl.mqtt.timeout
=
20
tdl.mqtt.timeout
=
20
# SSL Keys
# SSL Keys
...
@@ -54,15 +53,15 @@ tdl.mqtt.clientpwd =
...
@@ -54,15 +53,15 @@ tdl.mqtt.clientpwd =
# InfluxDB
# InfluxDB
#
spring.influxdb.username=witcloud
spring.influxdb.username
=
witcloud
#
spring.influxdb.password=Witcloud37774020
spring.influxdb.password
=
Witcloud37774020
#
spring.influxdb.url=https://ts-bp1q738i505oj79t7.influxdata.rds.aliyuncs.com:3242
spring.influxdb.url
=
https://ts-bp1q738i505oj79t7.influxdata.rds.aliyuncs.com:3242
#
spring.influxdb.database=logistics
spring.influxdb.database
=
logistics
spring.influxdb.url
=
http://172.16.1.14
:8086
#spring.influxdb.url=http://47.97.184.225
:8086
spring.influxdb.username
=
admin
#
spring.influxdb.username=admin
spring.influxdb.password
=
37774020
#
spring.influxdb.password=37774020
spring.influxdb.database
=
TDLData2
#spring.influxdb.database=original
spring.influxdb.retentionPolicy
=
tdl_policy
spring.influxdb.retentionPolicy
=
tdl_policy
spring.influxdb.connent-timeout
=
10
spring.influxdb.connent-timeout
=
10
spring.influxdb.read-timeout
=
30
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