Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
32e02a49
Commit
32e02a49
authored
Mar 24, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.5.2' into MVP1.5.2
parents
73477ea4
5a694292
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
21 deletions
+26
-21
CASproperties.java
...om/yifu/cloud/plus/v1/yifu/auth/config/CASproperties.java
+1
-13
PasswordDecoderFilter.java
...cloud/plus/v1/yifu/auth/filter/PasswordDecoderFilter.java
+24
-8
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+1
-0
No files found.
yifu-auth/src/main/java/com/yifu/cloud/plus/v1/yifu/auth/config/CASproperties.java
View file @
32e02a49
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
config
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
config
;
public
class
CASproperties
{
public
class
CASproperties
{
/**
* 当前应用程序的baseUrl(注意最后面的斜线)
*/
public
static
String
CLIENT_SERVER_NAME
=
"https://qas-mvp-1.worfu.com/"
;
/**
/**
* 当前应用程序的登陆界面
* 当前应用程序的登陆界面
...
@@ -16,15 +12,7 @@ public class CASproperties {
...
@@ -16,15 +12,7 @@ public class CASproperties {
*/
*/
public
static
String
CAS_SERVER_PATH
=
"http://192.168.1.62:8443/cas"
;
public
static
String
CAS_SERVER_PATH
=
"http://192.168.1.62:8443/cas"
;
/**
* CAS登陆服务器地址
*/
public
static
String
CAS_SERVER_LOGIN_PATH
=
"http://192.168.1.62:8443/cas/login"
;
/**
* CAS登出服务器地址
*/
public
static
String
CAS_SERVER_LOGOUT_PATH
=
"http://192.168.1.62:8443/cas/logout"
;
public
static
String
SPRING_SECURITY_CAS_SERVER
=
"http://192.168.1.62:8443/cas/v1/tickets"
;
public
static
String
SPRING_SECURITY_CAS_SERVER
=
"http://192.168.1.62:8443/cas/v1/tickets"
;
}
}
yifu-auth/src/main/java/com/yifu/cloud/plus/v1/yifu/auth/filter/PasswordDecoderFilter.java
View file @
32e02a49
...
@@ -3,6 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.auth.filter;
...
@@ -3,6 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.auth.filter;
import
cn.hutool.crypto.Mode
;
import
cn.hutool.crypto.Mode
;
import
cn.hutool.crypto.Padding
;
import
cn.hutool.crypto.Padding
;
import
cn.hutool.crypto.symmetric.AES
;
import
cn.hutool.crypto.symmetric.AES
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yifu.cloud.plus.v1.yifu.auth.config.CASproperties
;
import
com.yifu.cloud.plus.v1.yifu.auth.config.CASproperties
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.security.token.CasAuthenticationToken
;
import
com.yifu.cloud.plus.v1.yifu.common.security.token.CasAuthenticationToken
;
...
@@ -51,12 +53,9 @@ public class PasswordDecoderFilter extends UsernamePasswordAuthenticationFilter
...
@@ -51,12 +53,9 @@ public class PasswordDecoderFilter extends UsernamePasswordAuthenticationFilter
throw
new
AuthenticationServiceException
(
"Authentication method not supported: "
+
request
.
getMethod
());
throw
new
AuthenticationServiceException
(
"Authentication method not supported: "
+
request
.
getMethod
());
}
else
{
}
else
{
AbstractAuthenticationToken
authRequest
;
AbstractAuthenticationToken
authRequest
;
String
result
=
request
.
getParameter
(
"cas"
);
String
casResult
=
request
.
getParameter
(
"cas"
);
String
username
=
this
.
obtainUsername
(
request
);
if
(
Common
.
isNotNull
(
casResult
))
{
username
=
username
!=
null
?
username
:
""
;
String
ldapName
=
""
;
username
=
username
.
trim
();
if
(
Common
.
isNotNull
(
result
))
{
try
{
try
{
RestTemplate
restTemplate
=
new
RestTemplate
();
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpHeaders
headers
=
new
HttpHeaders
();
HttpHeaders
headers
=
new
HttpHeaders
();
...
@@ -64,18 +63,35 @@ public class PasswordDecoderFilter extends UsernamePasswordAuthenticationFilter
...
@@ -64,18 +63,35 @@ public class PasswordDecoderFilter extends UsernamePasswordAuthenticationFilter
MultiValueMap
<
String
,
Object
>
wholeForm
=
new
LinkedMultiValueMap
<>();
MultiValueMap
<
String
,
Object
>
wholeForm
=
new
LinkedMultiValueMap
<>();
wholeForm
.
add
(
"service"
,
CASproperties
.
CLIENT_LOGIN_PAGE
);
wholeForm
.
add
(
"service"
,
CASproperties
.
CLIENT_LOGIN_PAGE
);
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
entity
=
new
org
.
springframework
.
http
.
HttpEntity
<>(
wholeForm
,
headers
);
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
entity
=
new
org
.
springframework
.
http
.
HttpEntity
<>(
wholeForm
,
headers
);
ResponseEntity
<
String
>
obj
=
restTemplate
.
exchange
(
CASproperties
.
SPRING_SECURITY_CAS_SERVER
+
"/"
+
r
esult
,
HttpMethod
.
POST
,
entity
,
String
.
class
);
ResponseEntity
<
String
>
obj
=
restTemplate
.
exchange
(
CASproperties
.
SPRING_SECURITY_CAS_SERVER
+
"/"
+
casR
esult
,
HttpMethod
.
POST
,
entity
,
String
.
class
);
if
(
obj
.
getStatusCode
().
value
()
==
200
)
{
if
(
obj
.
getStatusCode
().
value
()
==
200
)
{
String
st
=
obj
.
getBody
();
String
st
=
obj
.
getBody
();
log
.
info
(
"Successful service ticket request: "
+
st
);
log
.
info
(
"Successful service ticket request: "
+
st
);
wholeForm
.
clear
();
wholeForm
.
add
(
"service"
,
CASproperties
.
CLIENT_LOGIN_PAGE
);
wholeForm
.
add
(
"ticket"
,
st
);
obj
=
restTemplate
.
getForEntity
(
CASproperties
.
CAS_SERVER_PATH
+
"/p3/serviceValidate?service="
+
CASproperties
.
CLIENT_LOGIN_PAGE
+
"&ticket="
+
st
+
"&format=JSON"
,
String
.
class
,
CASproperties
.
CLIENT_LOGIN_PAGE
,
st
,
"JSON"
);
log
.
info
(
"cas返回用户信息》》》"
,
JSON
.
toJSONString
(
obj
));
if
(
obj
.
getStatusCode
().
value
()
==
200
){
try
{
JSONObject
result
=
JSON
.
parseObject
(
obj
.
getBody
());
ldapName
=
result
.
getJSONObject
(
"serviceResponse"
).
getJSONObject
(
"authenticationSuccess"
).
getString
(
"user"
);
}
catch
(
Exception
var6
){
throw
new
AuthenticationServiceException
(
"验证失败!统一用户中心未正确获得用户信息!"
);
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
());
throw
new
AuthenticationServiceException
(
"验证失败!"
);
throw
new
AuthenticationServiceException
(
"验证失败!"
);
}
}
authRequest
=
new
CasAuthenticationToken
(
usern
ame
,
null
);
authRequest
=
new
CasAuthenticationToken
(
ldapN
ame
,
null
);
}
else
{
}
else
{
String
username
=
this
.
obtainUsername
(
request
);
username
=
username
!=
null
?
username
:
""
;
username
=
username
.
trim
();
String
password
=
this
.
obtainPassword
(
request
);
String
password
=
this
.
obtainPassword
(
request
);
password
=
password
!=
null
?
decryptAES
(
password
)
:
""
;
password
=
password
!=
null
?
decryptAES
(
password
)
:
""
;
authRequest
=
new
UsernamePasswordAuthenticationToken
(
username
,
password
);
authRequest
=
new
UsernamePasswordAuthenticationToken
(
username
,
password
);
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
32e02a49
...
@@ -3492,6 +3492,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3492,6 +3492,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List
<
TInsuranceEkp
>
ekpList
;
List
<
TInsuranceEkp
>
ekpList
;
for
(
int
i
=
0
;
i
<
distinctList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
distinctList
.
size
();
i
++)
{
param
=
distinctList
.
get
(
i
);
param
=
distinctList
.
get
(
i
);
param
.
setFlag
(
CommonConstants
.
ONE_STRING
);
// 必填校验
// 必填校验
if
(
StringUtils
.
isBlank
(
param
.
getEmpName
())){
if
(
StringUtils
.
isBlank
(
param
.
getEmpName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_NOT_EMPTY
);
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_NOT_EMPTY
);
...
...
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