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
528e55f2
Commit
528e55f2
authored
Apr 07, 2021
by
zhengjiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
8c0c6c2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
TokenLoginController.java
...in/amos/fas/business/controller/TokenLoginController.java
+9
-6
PrivilegeFeign.java
...a/com/yeejoin/amos/fas/business/feign/PrivilegeFeign.java
+6
-0
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+2
-2
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/TokenLoginController.java
View file @
528e55f2
...
...
@@ -63,6 +63,11 @@ public class TokenLoginController {
@Value
(
"${outSystem.user.password}"
)
private
String
password
;
@Value
(
"${security.productWeb}"
)
private
String
product
;
@Value
(
"${security.appKeyWeb}"
)
private
String
appKey
;
@ApiOperation
(
value
=
"外部token登錄"
,
notes
=
"查询设备指标"
)
@GetMapping
(
value
=
"/{token}"
)
...
...
@@ -75,10 +80,6 @@ public class TokenLoginController {
if
(
ObjectUtils
.
isEmpty
(
userId
)){
throw
new
Exception
(
"用户信息不存在"
);
}
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
String
token
=
(
String
)
request
.
getHeader
(
"token"
);
String
product
=
(
String
)
request
.
getHeader
(
"product"
);
String
appKey
=
(
String
)
request
.
getHeader
(
"appKey"
);
ReginParams
reginParams
;
reginParams
=
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
userId
,
outToken
)),
ReginParams
.
class
);
...
...
@@ -87,13 +88,15 @@ public class TokenLoginController {
Map
<
String
,
String
>
param
=
new
HashMap
<>();
param
.
put
(
"loginId"
,
userId
);
param
.
put
(
"password"
,
password
);
param
.
put
(
"remembered"
,
"false"
);
Object
result
=
privilegeFeign
.
login
(
appKey
,
product
,
outToken
,
param
).
getResult
();
if
(
ObjectUtils
.
isEmpty
(
result
)){
throw
new
Exception
(
"缺失登录信息"
);
}
Map
<
String
,
String
>
re
=
(
Map
<
String
,
String
>)
privilegeFeign
.
login
(
appKey
,
product
,
outToken
,
param
).
getResult
();
token
=
re
.
get
(
"token"
);
Map
<
String
,
String
>
re
=
(
Map
<
String
,
String
>)
result
;
String
token
=
re
.
get
(
"token"
);
privilegeFeign
.
warrant
(
appKey
,
product
,
token
);
RequestContext
.
setToken
(
token
);
RequestContext
.
setProduct
(
product
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/PrivilegeFeign.java
View file @
528e55f2
...
...
@@ -20,4 +20,10 @@ public interface PrivilegeFeign {
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
@RequestHeader
(
name
=
"token"
,
required
=
true
)
String
token
,
@RequestBody
Map
person
);
@RequestMapping
(
value
=
"privilege/v1/application/list/user/service"
,
method
=
RequestMethod
.
GET
)
FeignClientResult
warrant
(
@RequestHeader
(
name
=
"appKey"
,
required
=
true
)
String
appKey
,
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
@RequestHeader
(
name
=
"token"
,
required
=
true
)
String
token
);
}
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
528e55f2
spring.application.name
=
AMOS-AUTOSYS
-TT
spring.application.name
=
AMOS-AUTOSYS
server.servlet.context-path
=
/fireAutoSys
server.port
=
11024
server.port
=
8085
spring.profiles.active
=
dev
#应用product appkey
security.productWeb
=
STUDIO_APP_WEB
...
...
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