Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
b93a94c8
Commit
b93a94c8
authored
Sep 14, 2022
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
机器人账号自动登陆调整为平台功能
parent
c39e03f8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
40 deletions
+78
-40
pom.xml
...e/amos-boot-module-biz/amos-boot-module-equip-biz/pom.xml
+15
-0
CarController.java
...ava/com/yeejoin/equipmanage/controller/CarController.java
+1
-1
RemoteSecurityService.java
...com/yeejoin/equipmanage/remote/RemoteSecurityService.java
+13
-19
application-dev.properties
...ystem-equip/src/main/resources/application-dev.properties
+9
-4
application-docker.properties
...em-equip/src/main/resources/application-docker.properties
+10
-4
application-jcs.properties
...ystem-equip/src/main/resources/application-jcs.properties
+10
-4
application-qa.properties
...system-equip/src/main/resources/application-qa.properties
+10
-4
application-test.properties
...stem-equip/src/main/resources/application-test.properties
+10
-4
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/pom.xml
View file @
b93a94c8
...
@@ -51,6 +51,21 @@
...
@@ -51,6 +51,21 @@
<artifactId>
geodesy
</artifactId>
<artifactId>
geodesy
</artifactId>
<version>
1.1.3
</version>
<version>
1.1.3
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-authtoken
</artifactId>
<version>
1.7.13-SNAPSHOT
</version>
<exclusions>
<exclusion>
<groupId>
org.typroject
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
<exclusion>
<groupId>
io.springfox
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/CarController.java
View file @
b93a94c8
...
@@ -121,7 +121,7 @@ public class CarController extends AbstractBaseController {
...
@@ -121,7 +121,7 @@ public class CarController extends AbstractBaseController {
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@Value
(
"${security.productApp}"
)
@Value
(
"${security.productApp}"
)
private
String
productApp
;
private
String
productApp
;
@Value
(
"${
security.appKeyApp
}"
)
@Value
(
"${
amos.system.user.app-key
}"
)
private
String
appKeyApp
;
private
String
appKeyApp
;
@Value
(
"${iot.vehicle.track}"
)
@Value
(
"${iot.vehicle.track}"
)
private
String
iotServerName
;
private
String
iotServerName
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/remote/RemoteSecurityService.java
View file @
b93a94c8
...
@@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.amos.component.authtoken.robot.AmosRequestContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
@@ -46,18 +47,15 @@ import com.yeejoin.equipmanage.common.vo.Token;
...
@@ -46,18 +47,15 @@ import com.yeejoin.equipmanage.common.vo.Token;
@Service
(
"remoteSecurityService"
)
@Service
(
"remoteSecurityService"
)
public
class
RemoteSecurityService
{
public
class
RemoteSecurityService
{
@Value
(
"${security.password}"
)
@Autowired
AmosRequestContext
amosRequestContext
;
@Value
(
"${amos.system.user.password}"
)
private
String
password
;
private
String
password
;
@Value
(
"${security.loginId}"
)
private
String
loginId
;
@Value
(
"${security.productWeb}"
)
private
String
productWeb
;
@Value
(
"${security.productApp}"
)
@Value
(
"${security.productApp}"
)
private
String
productApp
;
private
String
productApp
;
@Value
(
"${
security.appKeyApp
}"
)
@Value
(
"${
amos.system.user.app-key
}"
)
private
String
appKeyApp
;
private
String
appKeyApp
;
@Autowired
@Autowired
...
@@ -410,15 +408,15 @@ public class RemoteSecurityService {
...
@@ -410,15 +408,15 @@ public class RemoteSecurityService {
public
Token
getServerToken
()
{
public
Token
getServerToken
()
{
IdPasswordAuthModel
dPasswordAuthModel
=
new
IdPasswordAuthModel
();
IdPasswordAuthModel
dPasswordAuthModel
=
new
IdPasswordAuthModel
();
dPasswordAuthModel
.
setLoginId
(
loginId
);
dPasswordAuthModel
.
setLoginId
(
amosRequestContext
.
getUserName
()
);
dPasswordAuthModel
.
setPassword
(
DesUtil
.
encode
(
password
,
"qaz"
));
dPasswordAuthModel
.
setPassword
(
DesUtil
.
encode
(
password
,
"qaz"
));
Token
toke
=
null
;
Token
toke
=
null
;
try
{
try
{
toke
=
JSON
.
parseObject
(
this
.
redisTemplate
.
opsForValue
().
get
(
buildKey
(
loginId
)),
Token
.
class
);
toke
=
JSON
.
parseObject
(
this
.
redisTemplate
.
opsForValue
().
get
(
buildKey
(
amosRequestContext
.
getUserName
()
)),
Token
.
class
);
if
(
ObjectUtils
.
isEmpty
(
toke
))
{
if
(
ObjectUtils
.
isEmpty
(
toke
))
{
toke
=
getLogin
(
dPasswordAuthModel
);
toke
=
getLogin
(
dPasswordAuthModel
);
}
else
{
}
else
{
RequestContext
.
setProduct
(
productWeb
);
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
()
);
if
(!
redisUtils
.
refresh
(
toke
.
getToke
()))
{
if
(!
redisUtils
.
refresh
(
toke
.
getToke
()))
{
toke
=
getLogin
(
dPasswordAuthModel
);
toke
=
getLogin
(
dPasswordAuthModel
);
}
}
...
@@ -436,15 +434,11 @@ public class RemoteSecurityService {
...
@@ -436,15 +434,11 @@ public class RemoteSecurityService {
private
Token
getLogin
(
IdPasswordAuthModel
dPasswordAuthModel
)
{
private
Token
getLogin
(
IdPasswordAuthModel
dPasswordAuthModel
)
{
Token
toke
=
new
Token
();
Token
toke
=
new
Token
();
RequestContext
.
setProduct
(
productWeb
);
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
FeignClientResult
feignClientResult
=
Privilege
.
authClient
.
idpassword
(
dPasswordAuthModel
);
toke
.
setToke
(
amosRequestContext
.
getToken
());
Map
map
=
(
Map
)
feignClientResult
.
getResult
();
toke
.
setProduct
(
amosRequestContext
.
getProduct
());
if
(
map
!=
null
)
{
toke
.
setAppKey
(
amosRequestContext
.
getAppKey
());
toke
.
setToke
(
map
.
get
(
"token"
).
toString
());
redisTemplate
.
opsForValue
().
set
(
buildKey
(
dPasswordAuthModel
.
getLoginId
()),
JSONObject
.
toJSONString
(
toke
),
28
,
TimeUnit
.
DAYS
);
toke
.
setProduct
(
productWeb
);
toke
.
setAppKey
(
appKeyApp
);
redisTemplate
.
opsForValue
().
set
(
buildKey
(
dPasswordAuthModel
.
getLoginId
()),
JSONObject
.
toJSONString
(
toke
),
28
,
TimeUnit
.
DAYS
);
}
return
toke
;
return
toke
;
}
}
}
}
amos-boot-system-equip/src/main/resources/application-dev.properties
View file @
b93a94c8
...
@@ -23,12 +23,17 @@ eureka.instance.prefer-ip-address = true
...
@@ -23,12 +23,17 @@ eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
#security config
#security config
security.password
=
a1234560
#
security.password=a1234560
security.loginId
=
fas_system
#
security.loginId=fas_system
security.productApp
=
STUDIO_APP_MOBILE
security.productApp
=
STUDIO_APP_MOBILE
security.productWeb
=
STUDIO_APP_WEB
#
security.productWeb=STUDIO_APP_WEB
security.appKeyApp
=
studio_normalapp_3056965
#
security.appKeyApp=studio_normalapp_3056965
amos.system.user.user-name
=
fas_system
amos.system.user.password
=
a1234560
amos.system.user.app-key
=
studio_normalapp_3056965
amos.system.user.product
=
STUDIO_APP_WEB
#redis
#redis
...
...
amos-boot-system-equip/src/main/resources/application-docker.properties
View file @
b93a94c8
...
@@ -17,11 +17,17 @@ eureka.instance.prefer-ip-address = true
...
@@ -17,11 +17,17 @@ eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
#security config
#security config
security.password
=
a1234560
#
security.password=a1234560
security.loginId
=
fas_system
#
security.loginId=fas_system
security.productApp
=
STUDIO_APP_MOBILE
security.productApp
=
STUDIO_APP_MOBILE
security.productWeb
=
STUDIO_APP_WEB
#security.productWeb=STUDIO_APP_WEB
security.appKeyApp
=
studio_normalapp_3056965
#security.appKeyApp=studio_normalapp_3056965
amos.system.user.user-name
=
fas_system
amos.system.user.password
=
a1234560
amos.system.user.app-key
=
studio_normalapp_3056965
amos.system.user.product
=
STUDIO_APP_WEB
#redis
#redis
spring.redis.database
=
1
spring.redis.database
=
1
...
...
amos-boot-system-equip/src/main/resources/application-jcs.properties
View file @
b93a94c8
...
@@ -23,11 +23,17 @@ eureka.instance.prefer-ip-address = true
...
@@ -23,11 +23,17 @@ eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
#security config
#security config
security.password
=
a1234560
#
security.password=a1234560
security.loginId
=
fas_system
#
security.loginId=fas_system
security.productApp
=
STUDIO_APP_MOBILE
security.productApp
=
STUDIO_APP_MOBILE
security.productWeb
=
STUDIO_APP_WEB
#security.productWeb=STUDIO_APP_WEB
security.appKeyApp
=
studio_normalapp_3157169
#security.appKeyApp=studio_normalapp_3056965
amos.system.user.user-name
=
fas_system
amos.system.user.password
=
a1234560
amos.system.user.app-key
=
studio_normalapp_3157169
amos.system.user.product
=
STUDIO_APP_WEB
#redis
#redis
spring.redis.database
=
0
spring.redis.database
=
0
...
...
amos-boot-system-equip/src/main/resources/application-qa.properties
View file @
b93a94c8
...
@@ -17,11 +17,17 @@ eureka.instance.prefer-ip-address = true
...
@@ -17,11 +17,17 @@ eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
#security config
#security config
security.password
=
a1234560
#
security.password=a1234560
security.loginId
=
fas_system
#
security.loginId=fas_system
security.productApp
=
STUDIO_APP_MOBILE
security.productApp
=
STUDIO_APP_MOBILE
security.productWeb
=
STUDIO_APP_WEB
#security.productWeb=STUDIO_APP_WEB
security.appKeyApp
=
studio_normalapp_3056965
#security.appKeyApp=studio_normalapp_3056965
amos.system.user.user-name
=
fas_system
amos.system.user.password
=
a1234560
amos.system.user.app-key
=
studio_normalapp_3056965
amos.system.user.product
=
STUDIO_APP_WEB
#redis
#redis
spring.redis.database
=
1
spring.redis.database
=
1
...
...
amos-boot-system-equip/src/main/resources/application-test.properties
View file @
b93a94c8
...
@@ -17,11 +17,17 @@ eureka.instance.prefer-ip-address = true
...
@@ -17,11 +17,17 @@ eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
#security config
#security config
security.password
=
a1234560
#
security.password=a1234560
security.loginId
=
fas_system
#
security.loginId=fas_system
security.productApp
=
STUDIO_APP_MOBILE
security.productApp
=
STUDIO_APP_MOBILE
security.productWeb
=
STUDIO_APP_WEB
#security.productWeb=STUDIO_APP_WEB
security.appKeyApp
=
studio_normalapp_3056965
#security.appKeyApp=studio_normalapp_3056965
amos.system.user.user-name
=
fas_system
amos.system.user.password
=
a1234560
amos.system.user.app-key
=
studio_normalapp_3056965
amos.system.user.product
=
STUDIO_APP_WEB
#redis
#redis
spring.redis.database
=
1
spring.redis.database
=
1
...
...
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