Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
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
Administrator
browser-backend
Commits
c3abce67
Commit
c3abce67
authored
Apr 08, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除IpBug
parent
2a265d3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
21 deletions
+25
-21
IpResourceServiceImpl.java
...erbackend/browser/service/Impl/IpResourceServiceImpl.java
+18
-14
Aes.java
src/main/java/com/edgec/browserbackend/common/utils/Aes.java
+7
-7
No files found.
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpResourceServiceImpl.java
View file @
c3abce67
...
@@ -362,16 +362,18 @@ public class IpResourceServiceImpl implements IpResourceService {
...
@@ -362,16 +362,18 @@ public class IpResourceServiceImpl implements IpResourceService {
}
}
UserShop
userShop
=
null
;
UserShop
userShop
=
null
;
Shop
shop
=
shopRepository
.
findById
(
ipResource
.
getShopId
()).
orElse
(
null
);
if
(
ipResource
.
getShopId
()
!=
null
)
{
if
(
shop
!=
null
)
{
Shop
shop
=
shopRepository
.
findById
(
ipResource
.
getShopId
()).
orElse
(
null
);
userShop
=
userShopRepository
.
findByUsernameAndShopId
(
username
,
shop
.
getShopId
());
if
(
shop
!=
null
)
{
if
(
userShop
==
null
)
{
userShop
=
userShopRepository
.
findByUsernameAndShopId
(
username
,
shop
.
getShopId
());
if
(
userShop
==
null
)
{
ipOperationResultDto
.
getFailList
().
add
(
ipAddr
);
return
;
}
}
else
if
(!
ipResource
.
getOwner
().
equals
(
username
))
{
ipOperationResultDto
.
getFailList
().
add
(
ipAddr
);
ipOperationResultDto
.
getFailList
().
add
(
ipAddr
);
return
;
return
;
}
}
}
else
if
(!
ipResource
.
getOwner
().
equals
(
username
))
{
ipOperationResultDto
.
getFailList
().
add
(
ipAddr
);
return
;
}
}
try
{
try
{
ResponseEntity
<
String
>
result
=
restTemplate
.
exchange
(
URL
+
"/intelligroup/ipresources?accountId=browser&ip={ip}"
,
HttpMethod
.
DELETE
,
httpEntity
,
String
.
class
,
ipAddr
);
ResponseEntity
<
String
>
result
=
restTemplate
.
exchange
(
URL
+
"/intelligroup/ipresources?accountId=browser&ip={ip}"
,
HttpMethod
.
DELETE
,
httpEntity
,
String
.
class
,
ipAddr
);
...
@@ -407,16 +409,18 @@ public class IpResourceServiceImpl implements IpResourceService {
...
@@ -407,16 +409,18 @@ public class IpResourceServiceImpl implements IpResourceService {
DeleteIpResultDto
deleteIpResultDto
=
JSON
.
parseObject
(
result
.
getBody
(),
DeleteIpResultDto
.
class
);
DeleteIpResultDto
deleteIpResultDto
=
JSON
.
parseObject
(
result
.
getBody
(),
DeleteIpResultDto
.
class
);
}
}
UserShop
userShop
=
null
;
UserShop
userShop
=
null
;
Shop
shop
=
shopRepository
.
findById
(
ipResource
.
getShopId
()).
orElse
(
null
);
if
(
ipResource
.
getShopId
()
!=
null
)
{
if
(
shop
!=
null
)
{
Shop
shop
=
shopRepository
.
findById
(
ipResource
.
getShopId
()).
orElse
(
null
);
userShop
=
userShopRepository
.
findByUsernameAndShopId
(
username
,
shop
.
getShopId
());
if
(
shop
!=
null
)
{
if
(
userShop
==
null
)
{
userShop
=
userShopRepository
.
findByUsernameAndShopId
(
username
,
shop
.
getShopId
());
if
(
userShop
==
null
)
{
ipOperationResultDto
.
getFailList
().
add
(
ipId
);
return
;
}
}
else
if
(!
ipResource
.
getOwner
().
equals
(
username
))
{
ipOperationResultDto
.
getFailList
().
add
(
ipId
);
ipOperationResultDto
.
getFailList
().
add
(
ipId
);
return
;
return
;
}
}
}
else
if
(!
ipResource
.
getOwner
().
equals
(
username
))
{
ipOperationResultDto
.
getFailList
().
add
(
ipId
);
return
;
}
}
ipResource
.
setDeleted
(
true
);
ipResource
.
setDeleted
(
true
);
ipResource
.
setShopId
(
null
);
ipResource
.
setShopId
(
null
);
...
...
src/main/java/com/edgec/browserbackend/common/utils/Aes.java
View file @
c3abce67
package
com
.
edgec
.
browserbackend
.
common
.
utils
;
package
com
.
edgec
.
browserbackend
.
common
.
utils
;
import
org.bouncycastle.jce.provider.BouncyCastleProvider
;
import
org.bouncycastle.jce.provider.BouncyCastleProvider
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
sun.misc.BASE64Decoder
;
import
sun.misc.BASE64Decoder
;
...
@@ -149,17 +150,16 @@ public class Aes {
...
@@ -149,17 +150,16 @@ public class Aes {
return
StringUtils
.
isEmpty
(
encryptStr
)
?
null
:
aesDecryptByBytes
(
base64Decode
(
encryptStr
),
decryptKey
);
return
StringUtils
.
isEmpty
(
encryptStr
)
?
null
:
aesDecryptByBytes
(
base64Decode
(
encryptStr
),
decryptKey
);
}
}
private
static
final
BCryptPasswordEncoder
encoder
=
new
BCryptPasswordEncoder
();
/**
/**
* 测试
* 测试
*/
*/
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
content
=
"VHRg3tocHf9i2Q27COKDhw=="
;
String
content
=
"abc123456"
;
// System.out.println("加密前:" + content);
System
.
out
.
println
(
"加密前:"
+
content
);
// System.out.println("加密密钥和解密密钥:" + KEY);
System
.
out
.
println
(
"加密密钥和解密密钥:"
+
KEY
);
// String encrypt = aesEncrypt(content, KEY);
String
encrypt
=
encoder
.
encode
(
content
);
// System.out.println("加密后:" + encrypt);
System
.
out
.
println
(
"加密后:"
+
encrypt
);
String
decrypt
=
aesDecrypt
(
content
,
KEY
);
System
.
out
.
println
(
"解密后:"
+
decrypt
);
}
}
}
}
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