Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
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
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
6fa3bfe0
Commit
6fa3bfe0
authored
May 27, 2021
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复两处存在SQL注入漏洞问题
parent
5e64a93d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
...ain/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
+14
-0
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
...system/src/main/resources/mapper/system/SysDeptMapper.xml
+1
-1
No files found.
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
View file @
6fa3bfe0
...
...
@@ -66,6 +66,7 @@ public class DataScopeAspect
@Before
(
"dataScopePointCut()"
)
public
void
doBefore
(
JoinPoint
point
)
throws
Throwable
{
clearDataScope
(
point
);
handleDataScope
(
point
);
}
...
...
@@ -166,4 +167,17 @@ public class DataScopeAspect
}
return
null
;
}
/**
* 拼接权限sql前先清空params.dataScope参数防止注入
*/
private
void
clearDataScope
(
final
JoinPoint
joinPoint
)
{
Object
params
=
joinPoint
.
getArgs
()[
0
];
if
(
StringUtils
.
isNotNull
(
params
)
&&
params
instanceof
BaseEntity
)
{
BaseEntity
baseEntity
=
(
BaseEntity
)
params
;
baseEntity
.
getParams
().
put
(
DATA_SCOPE
,
""
);
}
}
}
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
View file @
6fa3bfe0
...
...
@@ -147,7 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null and updateBy != ''"
>
update_by = #{updateBy},
</if>
update_time = sysdate()
</set>
where
dept_id in (${ancestors}
)
where
find_in_set(#{deptId}, ancestors
)
</update>
<delete
id=
"deleteDeptById"
parameterType=
"Long"
>
...
...
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