Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
8817dce4
Commit
8817dce4
authored
Mar 20, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限修改
parent
849fce4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
DealerRestrict.java
...join/amos/boot/module/hygf/api/config/DealerRestrict.java
+2
-4
DealerRestrictInterceptor.java
...oot/module/hygf/api/config/DealerRestrictInterceptor.java
+9
-6
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/config/DealerRestrict.java
View file @
8817dce4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
config
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
config
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.*
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
ElementType
.
METHOD
)
@Target
(
ElementType
.
METHOD
)
@Documented
public
@interface
DealerRestrict
{
public
@interface
DealerRestrict
{
String
[]
field
();
String
[]
field
();
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/config/DealerRestrictInterceptor.java
View file @
8817dce4
...
@@ -13,14 +13,15 @@ import net.sf.jsqlparser.parser.CCJSqlParserUtil;
...
@@ -13,14 +13,15 @@ import net.sf.jsqlparser.parser.CCJSqlParserUtil;
import
net.sf.jsqlparser.statement.select.PlainSelect
;
import
net.sf.jsqlparser.statement.select.PlainSelect
;
import
net.sf.jsqlparser.statement.select.Select
;
import
net.sf.jsqlparser.statement.select.Select
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.ibatis.executor.Executor
;
import
org.apache.ibatis.executor.statement.StatementHandler
;
import
org.apache.ibatis.executor.statement.StatementHandler
;
import
org.apache.ibatis.mapping.BoundSql
;
import
org.apache.ibatis.mapping.BoundSql
;
import
org.apache.ibatis.mapping.MappedStatement
;
import
org.apache.ibatis.mapping.MappedStatement
;
import
org.apache.ibatis.plugin.Interceptor
;
import
org.apache.ibatis.plugin.*
;
import
org.apache.ibatis.plugin.Invocation
;
import
org.apache.ibatis.plugin.Plugin
;
import
org.apache.ibatis.reflection.MetaObject
;
import
org.apache.ibatis.reflection.MetaObject
;
import
org.apache.ibatis.reflection.SystemMetaObject
;
import
org.apache.ibatis.reflection.SystemMetaObject
;
import
org.apache.ibatis.session.ResultHandler
;
import
org.apache.ibatis.session.RowBounds
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
...
@@ -31,10 +32,12 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...
@@ -31,10 +32,12 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.sql.Connection
;
import
java.util.*
;
import
java.util.*
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
parseArray
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
parseArray
;
@Intercepts
({
@Signature
(
type
=
Executor
.
class
,
method
=
"query"
,
args
=
{
MappedStatement
.
class
,
Object
.
class
,
RowBounds
.
class
,
ResultHandler
.
class
}),
@Signature
(
type
=
StatementHandler
.
class
,
method
=
"prepare"
,
args
=
{
Connection
.
class
,
Integer
.
class
})})
public
class
DealerRestrictInterceptor
implements
Interceptor
{
public
class
DealerRestrictInterceptor
implements
Interceptor
{
@Value
(
"classpath:/json/DealerRestrict.json"
)
@Value
(
"classpath:/json/DealerRestrict.json"
)
...
@@ -60,7 +63,7 @@ public class DealerRestrictInterceptor implements Interceptor {
...
@@ -60,7 +63,7 @@ public class DealerRestrictInterceptor implements Interceptor {
//获取 参数之间关系
//获取 参数之间关系
String
fileBetweenCondition
=
dealerRestrict
.
relationship
();
String
fileBetweenCondition
=
dealerRestrict
.
relationship
();
//获取参数值,
//获取参数值,
StdUserEmpower
dataAuthRule
=
UserEmpowerThreadLocal
.
getDataAuthRule
(
);
StdUserEmpower
dataAuthRule
=
(
StdUserEmpower
)
redisUtils
.
get
(
"Emp_"
+
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())
);
String
[]
data
=
new
String
[]{
dataAuthRule
.
getDeveloperId
().
toString
(),
dataAuthRule
.
getRegionalCompaniesCode
(),
dataAuthRule
.
getUserId
()};
String
[]
data
=
new
String
[]{
dataAuthRule
.
getDeveloperId
().
toString
(),
dataAuthRule
.
getRegionalCompaniesCode
(),
dataAuthRule
.
getUserId
()};
BoundSql
boundSql
=
(
BoundSql
)
metaObject
.
getValue
(
"delegate.boundSql"
);
BoundSql
boundSql
=
(
BoundSql
)
metaObject
.
getValue
(
"delegate.boundSql"
);
...
@@ -155,7 +158,7 @@ public class DealerRestrictInterceptor implements Interceptor {
...
@@ -155,7 +158,7 @@ public class DealerRestrictInterceptor implements Interceptor {
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
BadRequest
(
"权限认证失败!"
);
throw
new
BadRequest
(
"权限认证失败!"
);
}
finally
{
}
finally
{
UserEmpowerThreadLocal
.
clean
();
}
}
return
invocation
.
proceed
();
return
invocation
.
proceed
();
}
}
...
...
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