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
64e3c00e
Commit
64e3c00e
authored
May 29, 2020
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
免密登录
parent
6d13cee1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
89 additions
and
19 deletions
+89
-19
AvoidLoginController.java
...in/amos/fas/business/controller/AvoidLoginController.java
+48
-0
CommonController.java
...eejoin/amos/fas/business/controller/CommonController.java
+2
-0
CurCompanyController.java
...in/amos/fas/business/controller/CurCompanyController.java
+0
-3
RemoteSecurityService.java
...eejoin/amos/fas/business/feign/RemoteSecurityService.java
+27
-5
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+3
-11
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+3
-0
application-docker.properties
...SysStart/src/main/resources/application-docker.properties
+3
-0
application-test.properties
...toSysStart/src/main/resources/application-test.properties
+3
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/AvoidLoginController.java
0 → 100644
View file @
64e3c00e
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @Author: xinglei
* @Description:
* @Date: 2020/5/27 15:26
*/
@RestController
@RequestMapping
(
"/api/login"
)
@Api
(
"免密登录api"
)
public
class
AvoidLoginController
extends
BaseController
{
@Value
(
"${oauth2.accessToken}"
)
private
String
checkAccessToken
;
@Value
(
"${oauth2.password}"
)
private
String
password
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"免密登录获取token"
,
notes
=
"免密登录获取token"
)
@RequestMapping
(
value
=
"/avoid/{loginId}/{accessToken}/{expireTime}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
avoidLogin
(
@PathVariable
String
loginId
,
@PathVariable
String
accessToken
,
@PathVariable
Integer
expireTime
)
{
if
(
accessToken
.
equals
(
checkAccessToken
)){
Toke
toke
=
remoteSecurityService
.
avoidLogin
(
loginId
,
password
,
expireTime
);
return
CommonResponseUtil
.
success
(
toke
);
}
return
CommonResponseUtil
.
failure
(
"令牌不正确"
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/CommonController.java
View file @
64e3c00e
...
...
@@ -174,4 +174,6 @@ public class CommonController extends BaseController {
List
<
AgencyUserModel
>
users
=
commonService
.
getAllUser
(
getToken
(),
getProduct
(),
getAppKey
(),
compCode
);
return
CommonResponseUtil
.
success
(
users
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/CurCompanyController.java
View file @
64e3c00e
...
...
@@ -24,9 +24,6 @@ public class CurCompanyController extends BaseController {
map
.
put
(
"company"
,
getSelectedOrgInfo
().
getCompany
());
map
.
put
(
"department"
,
getSelectedOrgInfo
().
getDepartment
());
return
CommonResponseUtil
.
success
(
map
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteSecurityService.java
View file @
64e3c00e
...
...
@@ -164,11 +164,33 @@ public class RemoteSecurityService {
}
/**
* 免密登录
* @return
*/
public
Toke
avoidLogin
(
String
loginId
,
String
password
,
Integer
expireTime
){
StationAuthModel
stationAuthModel
=
new
StationAuthModel
();
stationAuthModel
.
setLoginId
(
loginId
);
stationAuthModel
.
setPassword
(
password
);
stationAuthModel
.
setExpireTime
(
expireTime
);
Map
map
=
null
;
FeignClientResult
feignClientResult
;
Toke
oked
=
new
Toke
();
try
{
RequestContext
.
setProduct
(
productWeb
);
feignClientResult
=
Privilege
.
authClient
.
idpasswordStation
(
stationAuthModel
);
//Privilege.authClient.idpasswordStation();
map
=
(
Map
)
feignClientResult
.
getResult
();
if
(
map
!=
null
){
oked
.
setToke
(
map
.
get
(
"token"
).
toString
());
oked
.
setProduct
(
productWeb
);
oked
.
setAppKey
(
appKeyWeb
);
}
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
oked
;
}
/* public List<UserModel> listUserByRoleIds(String roleIds) {
CommonResponse commonResponse = iAmosSecurityServer.listUserByRoleIds(roleIds);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
64e3c00e
...
...
@@ -56,6 +56,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.component.cache.enumeration.CacheType
;
...
...
@@ -540,17 +541,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
content
=
fmeaPointInputitemMapper
.
listByFmeaId
(
fmeaId
,
pageNumber
,
pageSize
);
if
(!
CollectionUtils
.
isEmpty
(
content
)){
Set
<
String
>
userIds
=
new
HashSet
<>();
Set
<
String
>
deptIds
=
new
HashSet
<>();
for
(
Map
<
String
,
Object
>
map
:
content
)
{
String
userId
=
String
.
valueOf
(
map
.
get
(
"userId"
));
String
deptId
=
String
.
valueOf
(
map
.
get
(
"deptId"
));
userIds
.
add
(
userId
);
deptIds
.
add
(
deptId
);
}
userIds
.
remove
(
null
);
deptIds
.
remove
(
null
);
Set
<
Object
>
userIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"userId"
))).
map
(
arg0
->
arg0
.
get
(
"userId"
)).
collect
(
Collectors
.
toSet
());
Set
<
Object
>
deptIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"deptId"
))).
map
(
arg0
->
arg0
.
get
(
"deptId"
)).
collect
(
Collectors
.
toSet
());
List
<
AgencyUserModel
>
users
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
64e3c00e
...
...
@@ -3,6 +3,9 @@ security.loginId=tw3
security.productWeb
=
CONVERTER_STATION_WEB
security.appKeyWeb
=
CONVERTER_STATION
oauth2.accessToken
=
my
oauth2.password
=
a123456
#environment
#spring.profiles.active = dev
eureka.client.serviceUrl.defaultZone
=
http://172.16.3.75:10001/eureka/
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-docker.properties
View file @
64e3c00e
...
...
@@ -3,6 +3,9 @@ security.loginId=tw3
security.productWeb
=
CONVERTER_STATION_WEB
security.appKeyWeb
=
CONVERTER_STATION
oauth2.accessToken
=
my
oauth2.password
=
a123456
#environment
#spring.profiles.active = dev
eureka.client.serviceUrl.defaultZone
=
http://amos-eurka:10001/eureka/
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-test.properties
View file @
64e3c00e
...
...
@@ -3,6 +3,9 @@ security.loginId=tw3
security.productWeb
=
CONVERTER_STATION_WEB
security.appKeyWeb
=
CONVERTER_STATION
oauth2.accessToken
=
my
oauth2.password
=
a123456
#environment
#spring.profiles.active = dev
eureka.client.serviceUrl.defaultZone
=
http://172.16.10.72:10001/eureka/
...
...
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