Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
Overview
Overview
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
s_guodong
gjjs-bd-common
Commits
b14012a7
Commit
b14012a7
authored
Oct 31, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步实施场地代码
parent
7ef7a334
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
29 deletions
+54
-29
LoginConstants.java
...s/src/main/java/com/ceb/gjjs/mda/util/LoginConstants.java
+15
-13
LoginData.java
...siness/src/main/java/com/ceb/gjjs/mda/util/LoginData.java
+3
-0
AuthInterceptor.java
...s/src/main/java/com/ceb/gjjs/mda/web/AuthInterceptor.java
+4
-4
AuthorizationRequestFilter.java
...java/com/ceb/gjjs/mda/web/AuthorizationRequestFilter.java
+10
-1
BDAuthInfo.java
...c/main/java/com/brilliance/mda/support/td/BDAuthInfo.java
+22
-11
No files found.
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/util/LoginConstants.java
View file @
b14012a7
...
@@ -8,28 +8,30 @@ public class LoginConstants {
...
@@ -8,28 +8,30 @@ public class LoginConstants {
//核心编号
//核心编号
public
static
final
String
cid
=
"cid"
;
public
static
final
String
cid
=
"cid"
;
//企业操作员编号
//企业操作员编号
public
static
final
String
oid
=
"oid"
;
public
static
final
String
oid
=
"oid"
;
//网银编号
//网银编号
public
static
final
String
ncid
=
"ncid"
;
public
static
final
String
ncid
=
"ncid"
;
public
static
final
String
token
=
"__token"
;
public
static
final
String
token
=
"__token"
;
//用户ID
//用户ID
public
static
final
String
usrinr
=
"usrinr"
;
public
static
final
String
usrinr
=
"usrinr"
;
public
static
final
String
userid
=
"userid"
;
public
static
final
String
userid
=
"userid"
;
public
static
final
String
cifno
=
"cifno"
;
public
static
final
String
cifno
=
"cifno"
;
public
static
final
String
ptyinr
=
"ptyinr"
;
public
static
final
String
ptyinr
=
"ptyinr"
;
public
static
final
String
errorText
=
"errorText"
;
public
static
final
String
errorText
=
"errorText"
;
public
static
final
String
CN
=
"CN"
;
public
static
final
String
CN
=
"CN"
;
public
static
final
String
needSign
=
"needSign"
;
public
static
final
String
needSign
=
"needSign"
;
public
static
final
String
__terminalType
=
"__terminalType"
;
public
static
final
String
__terminalType
=
"__terminalType"
;
public
static
final
String
algorithm
=
"algorithm"
;
public
static
final
String
algorithm
=
"algorithm"
;
public
static
final
String
CERT
=
"CERT"
;
public
static
final
String
CERT
=
"CERT"
;
public
static
final
String
url
=
"url"
;
}
}
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/util/LoginData.java
View file @
b14012a7
...
@@ -31,6 +31,9 @@ public class LoginData {
...
@@ -31,6 +31,9 @@ public class LoginData {
}
else
if
(
LoginConstants
.
userid
.
equals
(
param
))
{
}
else
if
(
LoginConstants
.
userid
.
equals
(
param
))
{
BDAuthInfo
authInfo
=
(
BDAuthInfo
)
MdaEnv
.
getAuthInfo
();
BDAuthInfo
authInfo
=
(
BDAuthInfo
)
MdaEnv
.
getAuthInfo
();
return
authInfo
.
getUserid
();
return
authInfo
.
getUserid
();
}
else
if
(
LoginConstants
.
url
.
equals
(
param
))
{
BDAuthInfo
authInfo
=
(
BDAuthInfo
)
MdaEnv
.
getAuthInfo
();
return
authInfo
.
getUrl
();
}
}
return
null
;
return
null
;
}
}
...
...
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/web/AuthInterceptor.java
View file @
b14012a7
...
@@ -42,15 +42,15 @@ public class AuthInterceptor implements HandlerInterceptor {
...
@@ -42,15 +42,15 @@ public class AuthInterceptor implements HandlerInterceptor {
private
ICache
<
String
,
IAuthInfo
>
authInfoICache
;
private
ICache
<
String
,
IAuthInfo
>
authInfoICache
;
private
IAuthInfo
getOrCreateAuthInfo
(
String
tokenKey
,
Map
<
String
,
Object
>
headMap
)
{
private
IAuthInfo
getOrCreateAuthInfo
(
String
tokenKey
,
Map
<
String
,
Object
>
headMap
)
{
IAuthInfo
authInfo
=
authInfoICache
.
get
(
tokenKey
);
IAuthInfo
authInfo
=
authInfoICache
.
get
(
tokenKey
);
if
(
authInfo
==
null
)
{
if
(
authInfo
==
null
)
{
synchronized
(
authInfoICache
)
{
synchronized
(
authInfoICache
)
{
authInfo
=
authInfoICache
.
get
(
tokenKey
);
authInfo
=
authInfoICache
.
get
(
tokenKey
);
if
(
authInfo
==
null
)
{
if
(
authInfo
==
null
)
{
String
cid
=
headMap
.
get
(
LoginConstants
.
cid
).
toString
();
String
cid
=
headMap
.
get
(
LoginConstants
.
cid
).
toString
();
String
ncid
=
headMap
.
get
(
LoginConstants
.
ncid
).
toString
();
String
ncid
=
headMap
.
get
(
LoginConstants
.
ncid
).
toString
();
BDAuthInfo
tdAuthInfo
=
new
BDAuthInfo
(
cid
,
ncid
,
""
,
null
,
null
,
null
,
null
,
null
);
BDAuthInfo
tdAuthInfo
=
new
BDAuthInfo
(
cid
,
ncid
,
""
,
null
,
null
,
null
,
null
,
null
,
null
);
authInfo
=
tdAuthInfo
;
authInfo
=
tdAuthInfo
;
authInfoICache
.
store
(
tokenKey
,
authInfo
);
authInfoICache
.
store
(
tokenKey
,
authInfo
);
//构造authInfo,本该在登录里面做
//构造authInfo,本该在登录里面做
...
...
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/web/AuthorizationRequestFilter.java
View file @
b14012a7
...
@@ -70,6 +70,14 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
...
@@ -70,6 +70,14 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
headMap
.
put
(
LoginConstants
.
algorithm
,
algorithm
);
headMap
.
put
(
LoginConstants
.
algorithm
,
algorithm
);
headMap
.
put
(
LoginConstants
.
CERT
,
CERT
);
headMap
.
put
(
LoginConstants
.
CERT
,
CERT
);
// 解决sysmod下对登录用户校验的处理
String
urlPath
=
request
.
getUriInfo
().
getRequestUri
().
getPath
();
MdaEnv
.
setAttribute
(
"url"
,
urlPath
);
if
(
urlPath
.
contains
(
"querySignList"
)
||
urlPath
.
contains
(
"saveSgin"
))
{
headMap
.
put
(
LoginConstants
.
url
,
urlPath
);
}
//目前采用自动登录模式认证
//目前采用自动登录模式认证
getOrCreateAuthInfo
(
headMap
);
getOrCreateAuthInfo
(
headMap
);
//设置一些系统参数
//设置一些系统参数
...
@@ -88,7 +96,8 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
...
@@ -88,7 +96,8 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
String
__terminalType
=
headMap
.
get
(
LoginConstants
.
__terminalType
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
__terminalType
).
toString
();
String
__terminalType
=
headMap
.
get
(
LoginConstants
.
__terminalType
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
__terminalType
).
toString
();
String
algorithm
=
headMap
.
get
(
LoginConstants
.
algorithm
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
algorithm
).
toString
();
String
algorithm
=
headMap
.
get
(
LoginConstants
.
algorithm
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
algorithm
).
toString
();
String
CERT
=
headMap
.
get
(
LoginConstants
.
CERT
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
CERT
).
toString
();
String
CERT
=
headMap
.
get
(
LoginConstants
.
CERT
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
CERT
).
toString
();
BDAuthInfo
bdAuthInfo
=
new
BDAuthInfo
(
usrinr
,
ptyinr
,
errorText
,
__terminalType
,
needSign
,
CN
,
algorithm
,
CERT
);
String
url
=
headMap
.
get
(
LoginConstants
.
url
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
url
).
toString
();
BDAuthInfo
bdAuthInfo
=
new
BDAuthInfo
(
usrinr
,
ptyinr
,
errorText
,
__terminalType
,
needSign
,
CN
,
algorithm
,
CERT
,
url
);
MdaEnv
.
setAuthInfo
(
bdAuthInfo
);
MdaEnv
.
setAuthInfo
(
bdAuthInfo
);
return
bdAuthInfo
;
return
bdAuthInfo
;
}
}
...
...
gjjs-bd-runtime/src/main/java/com/brilliance/mda/support/td/BDAuthInfo.java
View file @
b14012a7
...
@@ -22,12 +22,15 @@ public class BDAuthInfo implements IAuthInfo {
...
@@ -22,12 +22,15 @@ public class BDAuthInfo implements IAuthInfo {
private
IStream
ddsStream
;
private
IStream
ddsStream
;
private
IStream
keepAuthInfo
;
private
IStream
keepAuthInfo
;
p
ublic
BDAuthInfo
(){}
p
rivate
String
url
;
public
BDAuthInfo
(
String
usrInr
,
String
ptyInr
,
String
errorText
,
String
terminalType
,
String
needSign
,
String
cn
,
String
algorithm
,
String
cert
)
{
public
BDAuthInfo
()
{
}
public
BDAuthInfo
(
String
usrInr
,
String
ptyInr
,
String
errorText
,
String
terminalType
,
String
needSign
,
String
cn
,
String
algorithm
,
String
cert
,
String
url
)
{
this
.
usrInr
=
usrInr
;
this
.
usrInr
=
usrInr
;
this
.
ptyInr
=
ptyInr
;
this
.
ptyInr
=
ptyInr
;
this
.
errorText
=
errorText
;
this
.
errorText
=
errorText
;
this
.
terminalType
=
terminalType
;
this
.
terminalType
=
terminalType
;
this
.
needSign
=
needSign
;
this
.
needSign
=
needSign
;
this
.
cn
=
cn
;
this
.
cn
=
cn
;
...
@@ -36,6 +39,7 @@ public class BDAuthInfo implements IAuthInfo {
...
@@ -36,6 +39,7 @@ public class BDAuthInfo implements IAuthInfo {
sysStream
=
new
StreamImpl
();
sysStream
=
new
StreamImpl
();
ddsStream
=
new
StreamImpl
();
ddsStream
=
new
StreamImpl
();
keepAuthInfo
=
new
StreamImpl
();
keepAuthInfo
=
new
StreamImpl
();
this
.
url
=
url
;
}
}
@Override
@Override
...
@@ -93,17 +97,16 @@ public class BDAuthInfo implements IAuthInfo {
...
@@ -93,17 +97,16 @@ public class BDAuthInfo implements IAuthInfo {
return
keepAuthInfo
;
return
keepAuthInfo
;
}
}
public
void
recoveryAuthInfo
(){
public
void
recoveryAuthInfo
()
{
List
<
String
>
keyRows
=
this
.
getKeepAuthInfo
().
getRows
();
List
<
String
>
keyRows
=
this
.
getKeepAuthInfo
().
getRows
();
List
<
String
>
sysRows
=
this
.
getSysStream
().
getRows
();
List
<
String
>
sysRows
=
this
.
getSysStream
().
getRows
();
for
(
int
i
=
0
;
i
<
keyRows
.
size
();
i
+=
2
)
{
for
(
int
i
=
0
;
i
<
keyRows
.
size
();
i
+=
2
)
{
String
key
=
keyRows
.
get
(
i
);
String
key
=
keyRows
.
get
(
i
);
String
value
=
keyRows
.
get
(
i
+
1
);
String
value
=
keyRows
.
get
(
i
+
1
);
int
idx
=
sysRows
.
indexOf
(
key
);
int
idx
=
sysRows
.
indexOf
(
key
);
if
(
idx
>=
0
){
if
(
idx
>=
0
)
{
sysRows
.
set
(
idx
+
1
,
value
);
sysRows
.
set
(
idx
+
1
,
value
);
}
}
else
{
else
{
sysRows
.
add
(
key
);
sysRows
.
add
(
key
);
sysRows
.
add
(
value
);
sysRows
.
add
(
value
);
}
}
...
@@ -137,4 +140,12 @@ public class BDAuthInfo implements IAuthInfo {
...
@@ -137,4 +140,12 @@ public class BDAuthInfo implements IAuthInfo {
public
void
setSrc
(
String
src
)
{
public
void
setSrc
(
String
src
)
{
this
.
src
=
src
;
this
.
src
=
src
;
}
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
}
}
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