Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
ce900365
Commit
ce900365
authored
Sep 14, 2022
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
机器人账号自动登陆调整为平台功能
parent
fe87cfca
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
40 deletions
+55
-40
pom.xml
YeeAmosFireAutoSysService/pom.xml
+15
-1
LoginController.java
...yeejoin/amos/fas/business/controller/LoginController.java
+2
-2
RemoteSecurityService.java
...eejoin/amos/fas/business/feign/RemoteSecurityService.java
+13
-24
HandlerMqttMessageImpl.java
...mos/fas/business/service/impl/HandlerMqttMessageImpl.java
+1
-1
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+8
-4
application-docker.properties
...SysStart/src/main/resources/application-docker.properties
+8
-4
application-test.properties
...toSysStart/src/main/resources/application-test.properties
+8
-4
No files found.
YeeAmosFireAutoSysService/pom.xml
View file @
ce900365
...
@@ -136,7 +136,21 @@
...
@@ -136,7 +136,21 @@
<version>
6.11
</version>
<version>
6.11
</version>
<scope>
test
</scope>
<scope>
test
</scope>
</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>
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/LoginController.java
View file @
ce900365
...
@@ -64,10 +64,10 @@ public class LoginController {
...
@@ -64,10 +64,10 @@ public class LoginController {
@Value
(
"${outSystem.user.password}"
)
@Value
(
"${outSystem.user.password}"
)
private
String
password
;
private
String
password
;
@Value
(
"${
security.productWeb
}"
)
@Value
(
"${
amos.system.user.product
}"
)
private
String
product
;
private
String
product
;
@Value
(
"${
security.appK
ey}"
)
@Value
(
"${
amos.system.user.app-k
ey}"
)
private
String
appKey
;
private
String
appKey
;
@ApiOperation
(
value
=
"通过userId登录"
,
notes
=
"查询设备指标"
)
@ApiOperation
(
value
=
"通过userId登录"
,
notes
=
"查询设备指标"
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteSecurityService.java
View file @
ce900365
...
@@ -9,6 +9,7 @@ import java.util.Set;
...
@@ -9,6 +9,7 @@ import java.util.Set;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
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
;
...
@@ -38,20 +39,12 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
...
@@ -38,20 +39,12 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
@Service
(
"remoteSecurityService"
)
@Service
(
"remoteSecurityService"
)
public
class
RemoteSecurityService
{
public
class
RemoteSecurityService
{
@Autowired
@Value
(
"${security.password}"
)
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.appKey}"
)
private
String
appKey
;
@Autowired
@Autowired
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
...
@@ -157,15 +150,15 @@ public class RemoteSecurityService {
...
@@ -157,15 +150,15 @@ public class RemoteSecurityService {
public
Toke
getServerToken
()
{
public
Toke
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"
));
Toke
toke
=
null
;
Toke
toke
=
null
;
try
{
try
{
toke
=
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
loginId
)),
Toke
.
class
);
toke
=
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
amosRequestContext
.
getUserName
()
)),
Toke
.
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
(!
TokenOperation
.
refresh
(
toke
.
getToke
()))
{
if
(!
TokenOperation
.
refresh
(
toke
.
getToke
()))
{
toke
=
getLogin
(
dPasswordAuthModel
);
toke
=
getLogin
(
dPasswordAuthModel
);
}
}
...
@@ -178,15 +171,11 @@ public class RemoteSecurityService {
...
@@ -178,15 +171,11 @@ public class RemoteSecurityService {
private
Toke
getLogin
(
IdPasswordAuthModel
dPasswordAuthModel
){
private
Toke
getLogin
(
IdPasswordAuthModel
dPasswordAuthModel
){
Toke
toke
=
new
Toke
();
Toke
toke
=
new
Toke
();
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
(
appKey
);
redisTemplate
.
opsForValue
().
set
(
buildKey
(
dPasswordAuthModel
.
getLoginId
()),
JSONObject
.
toJSONString
(
toke
),
28
,
TimeUnit
.
DAYS
);
}
return
toke
;
return
toke
;
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java
View file @
ce900365
...
@@ -130,7 +130,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
...
@@ -130,7 +130,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Value
(
"${autoSys.alarm.nameKeys}"
)
@Value
(
"${autoSys.alarm.nameKeys}"
)
private
String
nameKeys
;
private
String
nameKeys
;
@Value
(
"${
security.loginId
}"
)
@Value
(
"${
amos.system.user.user-name
}"
)
private
String
loginId
;
private
String
loginId
;
@Value
(
"${autoSys.fire.pool.index_key}"
)
@Value
(
"${autoSys.fire.pool.index_key}"
)
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
ce900365
...
@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true
...
@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.validationQuery
=
SELECT 1
#系统服务账号,用户后端服务调用
#系统服务账号,用户后端服务调用
security.password
=
a1234560
#security.password=a1234560
security.loginId
=
fas_autosys
#security.loginId=fas_autosys
amos.system.user.user-name
=
fas_autosys
amos.system.user.password
=
a1234560
#应用product appkey
#应用product appkey
security.productWeb
=
STUDIO_APP_WEB
#security.productWeb=STUDIO_APP_WEB
security.appKey
=
studio_normalapp_3056965
#security.appKey =studio_normalapp_3056965
amos.system.user.app-key
=
studio_normalapp_3056965
amos.system.user.product
=
STUDIO_APP_WEB
eureka.client.serviceUrl.defaultZone
=
http://172.16.11.201:10001/eureka/
eureka.client.serviceUrl.defaultZone
=
http://172.16.11.201:10001/eureka/
eureka.client.register-with-eureka
=
true
eureka.client.register-with-eureka
=
true
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-docker.properties
View file @
ce900365
...
@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true
...
@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.validationQuery
=
SELECT 1
#系统服务账号,用户后端服务调用
#系统服务账号,用户后端服务调用
security.password
=
a1234560
#security.password=a1234560
security.loginId
=
fas_autosys
#security.loginId=fas_autosys
amos.system.user.user-name
=
fas_autosys
amos.system.user.password
=
a1234560
#应用product appkey
#应用product appkey
security.productWeb
=
STUDIO_APP_WEB
#security.productWeb=STUDIO_APP_WEB
security.appKey
=
studio_normalapp_2681691
#security.appKey =studio_normalapp_3056965
amos.system.user.app-key
=
studio_normalapp_3056965
amos.system.user.product
=
STUDIO_APP_WEB
eureka.client.serviceUrl.defaultZone
=
http://172.16.11.20:10001/eureka/
eureka.client.serviceUrl.defaultZone
=
http://172.16.11.20:10001/eureka/
eureka.client.register-with-eureka
=
true
eureka.client.register-with-eureka
=
true
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-test.properties
View file @
ce900365
...
@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true
...
@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.validationQuery
=
SELECT 1
#系统服务账号,用户后端服务调用
#系统服务账号,用户后端服务调用
security.password
=
a1234560
#security.password=a1234560
security.loginId
=
fas_autosys
#security.loginId=fas_autosys
amos.system.user.user-name
=
fas_autosys
amos.system.user.password
=
a1234560
#应用product appkey
#应用product appkey
security.productWeb
=
STUDIO_APP_WEB
#security.productWeb=STUDIO_APP_WEB
security.appKey
=
studio_normalapp_2681691
#security.appKey =studio_normalapp_3056965
amos.system.user.app-key
=
studio_normalapp_3056965
amos.system.user.product
=
STUDIO_APP_WEB
eureka.client.serviceUrl.defaultZone
=
http://172.16.11.20:10001/eureka/
eureka.client.serviceUrl.defaultZone
=
http://172.16.11.20:10001/eureka/
eureka.client.register-with-eureka
=
true
eureka.client.register-with-eureka
=
true
...
...
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