Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
京
京能客户端
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王亚宁
京能客户端
Commits
886fb9d9
Commit
886fb9d9
authored
1 year ago
by
realize1020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登陆漏洞修复和改造
登陆漏洞修复和改造
parent
d9745b92
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
29 deletions
+44
-29
OBE-BUSINESS/src/com/gx/obe/WebserviceConstants.java
OBE-BUSINESS/src/com/gx/obe/WebserviceConstants.java
+5
-0
OBE-BUSINESS/src/com/gx/obe/business/UserLogin.java
OBE-BUSINESS/src/com/gx/obe/business/UserLogin.java
+35
-23
OBE-BUSINESS/src/com/gx/obe/web/platform/service/PlatformUserService.java
.../com/gx/obe/web/platform/service/PlatformUserService.java
+1
-1
OBE-BUSINESS/src/com/gx/obe/web/service/UserService.java
OBE-BUSINESS/src/com/gx/obe/web/service/UserService.java
+3
-5
No files found.
OBE-BUSINESS/src/com/gx/obe/WebserviceConstants.java
View file @
886fb9d9
...
@@ -442,5 +442,10 @@ public class WebserviceConstants {
...
@@ -442,5 +442,10 @@ public class WebserviceConstants {
*/
*/
public
static
final
String
GET_AI_RESULT_METHOD
=
"getAIResult.method"
;
public
static
final
String
GET_AI_RESULT_METHOD
=
"getAIResult.method"
;
/**
* 二次校验
*/
public
static
final
String
TWO_VIRIF
=
"userHS.do?checkEncryptionInfo"
;
}
}
This diff is collapsed.
Click to expand it.
OBE-BUSINESS/src/com/gx/obe/business/UserLogin.java
View file @
886fb9d9
...
@@ -2,6 +2,8 @@ package com.gx.obe.business;
...
@@ -2,6 +2,8 @@ package com.gx.obe.business;
import
java.util.Map
;
import
java.util.Map
;
import
org.apache.commons.lang3.StringUtils
;
import
com.gx.obe.components.core.Constants
;
import
com.gx.obe.components.core.Constants
;
import
com.gx.obe.components.core.enumeration.CommonEnum
;
import
com.gx.obe.components.core.enumeration.CommonEnum
;
import
com.gx.obe.components.core.enumeration.UserEnum
;
import
com.gx.obe.components.core.enumeration.UserEnum
;
...
@@ -93,6 +95,14 @@ public class UserLogin {
...
@@ -93,6 +95,14 @@ public class UserLogin {
if
(
result
.
isStatus
())
{
if
(
result
.
isStatus
())
{
Constants
.
USER
=
user
;
Constants
.
USER
=
user
;
//修改本地用户密码
//修改本地用户密码
boolean
updateResult
=
userService
.
updatePassword
(
userName
,
MD5Utils
.
getMD5String
(
password
),
result
.
getStrMessage
().
length
()>
4
?
result
.
getStrMessage
():
null
);
if
(
updateResult
)
{
result
.
setStatus
(
true
);
result
.
setStrMessage
(
"已更新本地密码,登录成功"
);
}
else
{
result
.
setStrMessage
(
"更新本地密码失败,登录失败"
);
}
user
.
setUserPassword
(
MD5Utils
.
getMD5String
(
password
));
user
.
setUserPassword
(
MD5Utils
.
getMD5String
(
password
));
Constants
.
USER
=
userService
.
loginRemote
(
user
);
Constants
.
USER
=
userService
.
loginRemote
(
user
);
if
(
null
==
Constants
.
USER
)
{
if
(
null
==
Constants
.
USER
)
{
...
@@ -100,7 +110,7 @@ public class UserLogin {
...
@@ -100,7 +110,7 @@ public class UserLogin {
result
.
setStrMessage
(
"远程登录异常!"
);
result
.
setStrMessage
(
"远程登录异常!"
);
}
}
}
else
{
}
else
{
return
new
BooleanResultDO
(
false
,
"用户名或密码错误"
);
return
new
BooleanResultDO
(
false
,
"用户名或密码错误"
);
}
}
return
result
;
return
result
;
}
else
{
}
else
{
...
@@ -128,6 +138,10 @@ public class UserLogin {
...
@@ -128,6 +138,10 @@ public class UserLogin {
}
else
{
}
else
{
result
=
new
BooleanResultDO
(
false
,(
String
)
platformResult
.
getHeader
().
getMsg
());
result
=
new
BooleanResultDO
(
false
,(
String
)
platformResult
.
getHeader
().
getMsg
());
}
}
LoginUserDTO
loginUserDTO
=
platformResult
.
getData
();
String
checkUserLogin
=
loginUserDTO
.
getCheckUserLogin
();
if
(
result
.
isStatus
())
{
if
(
result
.
isStatus
())
{
// 用户保存到本地库
// 用户保存到本地库
LoginUserDTO
loginUser
=
platformResult
.
getData
();
LoginUserDTO
loginUser
=
platformResult
.
getData
();
...
@@ -167,32 +181,30 @@ public class UserLogin {
...
@@ -167,32 +181,30 @@ public class UserLogin {
if
(
null
==
platformResult
)
{
if
(
null
==
platformResult
)
{
return
new
BooleanResultDO
(
false
,
"登录异常"
);
return
new
BooleanResultDO
(
false
,
"登录异常"
);
}
}
LoginUserDTO
loginUserDTO
=
platformResult
.
getData
();
String
checkUserLogin
=
loginUserDTO
.
getCheckUserLogin
();
if
(
StringUtils
.
isEmpty
(
checkUserLogin
))
{
return
new
BooleanResultDO
(
false
,
"登录异常"
);
}
if
(
Constants
.
PLATFOR_STATUS_OK
.
equals
((
String
)
platformResult
.
getHeader
().
getRet
()))
{
if
(
Constants
.
PLATFOR_STATUS_OK
.
equals
((
String
)
platformResult
.
getHeader
().
getRet
()))
{
LoginUserDTO
loginUserDTO
=
platformResult
.
getData
();
String
result
=
platformUserService
.
verify
(
checkUserLogin
);
if
(
isRemote
){
if
(
null
==
result
)
{
String
checkUserLogin
=
loginUserDTO
.
getCheckUserLogin
();
return
new
BooleanResultDO
(
false
,
"登录异常"
);
String
result
=
platformUserService
.
verify
(
checkUserLogin
);
if
(
null
==
result
)
{
return
new
BooleanResultDO
(
false
,
"登录异常"
);
}
try
{
String
decrypt
=
DESUtils
.
decrypt
(
result
,
"utf-8"
);
Map
<
String
,
String
>
resultMap
=
JsonUtil
.
strToMap
(
decrypt
);
if
(
resultMap
.
get
(
"ret"
).
equals
(
Constants
.
PLATFOR_STATUS_OK
))
{
return
new
BooleanResultDO
(
true
,
""
);
}
return
new
BooleanResultDO
(
false
,(
String
)
platformResult
.
getHeader
().
getMsg
());
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
return
new
BooleanResultDO
(
false
,
"登录异常"
);
}
// Map<String, Object> resultMap = JSONHelperTwo.toHashMap(decrypt);
// resultMap.get("ret");
}
}
return
new
BooleanResultDO
(
false
,
"登录异常"
);
try
{
String
decrypt
=
DESUtils
.
decrypt
(
result
,
"utf-8"
);
Map
<
String
,
String
>
resultMap
=
JsonUtil
.
strToMap
(
decrypt
);
if
(
resultMap
.
get
(
"ret"
).
equals
(
Constants
.
PLATFOR_STATUS_OK
))
{
return
new
BooleanResultDO
(
true
,
checkUserLogin
);
}
return
new
BooleanResultDO
(
false
,(
String
)
platformResult
.
getHeader
().
getMsg
());
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
return
new
BooleanResultDO
(
false
,
"登录异常"
);
}
}
else
{
}
else
{
return
new
BooleanResultDO
(
false
,
(
String
)
platformResult
.
getHeader
().
getMsg
()
);
return
new
BooleanResultDO
(
false
,
checkUserLogin
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
OBE-BUSINESS/src/com/gx/obe/web/platform/service/PlatformUserService.java
View file @
886fb9d9
...
@@ -59,7 +59,7 @@ public class PlatformUserService {
...
@@ -59,7 +59,7 @@ public class PlatformUserService {
*/
*/
public
String
verify
(
String
checkUserLogin
)
{
public
String
verify
(
String
checkUserLogin
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
String
method
=
PropertiesUtils
.
getWebserviceProperty
(
"userHS.do?checkEncryptionInfo"
,
"userHS.do?checkEncryptionInfo"
);
String
method
=
PropertiesUtils
.
getWebserviceProperty
(
WebserviceConstants
.
TWO_VIRIF
,
"userHS.do?checkEncryptionInfo"
);
String
stPlatformUrl
=
Constants
.
getPlatformUrl
(
method
);
String
stPlatformUrl
=
Constants
.
getPlatformUrl
(
method
);
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"checkUserLogin"
,
checkUserLogin
);
param
.
put
(
"checkUserLogin"
,
checkUserLogin
);
...
...
This diff is collapsed.
Click to expand it.
OBE-BUSINESS/src/com/gx/obe/web/service/UserService.java
View file @
886fb9d9
...
@@ -221,14 +221,12 @@ public class UserService {
...
@@ -221,14 +221,12 @@ public class UserService {
* @param USER_PASSWORD
* @param USER_PASSWORD
* @return
* @return
*/
*/
public
boolean
updatePassword
(
String
USER_ACCOUNT
,
String
USER_PASSWORD
){
public
boolean
updatePassword
(
String
USER_ACCOUNT
,
String
USER_PASSWORD
,
String
code
){
//获取服务器地址
//获取服务器地址
String
strWebServerUrl
=
Constants
.
getServiceUrl
(
URL
+
"/updatePassword"
);
String
strWebServerUrl
=
Constants
.
getServiceUrl
(
URL
+
"/updatePassword"
);
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
strWebServerUrl
=
strWebServerUrl
+
"?userAccount="
+
USER_ACCOUNT
+
"&userPassword="
+
USER_PASSWORD
+
"&code="
+
code
;
param
.
put
(
"userAccount"
,
USER_ACCOUNT
);
param
.
put
(
"userPassword"
,
USER_PASSWORD
);
try
{
try
{
String
result
=
NetworkRequest
.
get
(
strWebServerUrl
,
param
);
String
result
=
NetworkRequest
.
get
(
strWebServerUrl
);
return
ResultStatus
.
getReultStatusBoolean
(
result
);
return
ResultStatus
.
getReultStatusBoolean
(
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
...
...
This diff is collapsed.
Click to expand it.
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