Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
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
zengtianlai3
ioc_sixiang_license
Commits
a21ba397
Commit
a21ba397
authored
Jul 17, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xss 优化
parent
78800464
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
1 deletion
+8
-1
DeviceController.java
...java/iot/sixiang/license/controller/DeviceController.java
+2
-1
OperateController.java
...ava/iot/sixiang/license/controller/OperateController.java
+1
-0
ResourceContrller.java
...ava/iot/sixiang/license/controller/ResourceContrller.java
+2
-0
JwtFilter.java
license/src/main/java/iot/sixiang/license/jwt/JwtFilter.java
+2
-0
AlarmReadServiceImpl.java
...ot/sixiang/license/service/impl/AlarmReadServiceImpl.java
+1
-0
No files found.
license/src/main/java/iot/sixiang/license/controller/DeviceController.java
View file @
a21ba397
...
...
@@ -103,7 +103,8 @@ public class DeviceController {
@MyLog
(
title
=
"获取设备详细信息接口"
,
optParam
=
"#{pageNo},#{pageSize},#{appName},#{userName}"
,
businessType
=
BusinessType
.
SELECT
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少条"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
)})
public
PageResult
<
DeviceDetailVo
>
getDeviceDetailList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
,
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
)
{
appName
=
XssUtil
.
checkXSS
(
appName
);
userName
=
XssUtil
.
checkXSS
(
userName
);
PageInfoModel
<
DeviceDetailVo
>
records
=
deviceManager
.
getDeviceDetailList
(
pageNo
,
pageSize
,
appName
,
userName
);
int
total
=
records
.
getTotal
();
int
pages
=
total
/
pageSize
;
//pages为总页数
...
...
license/src/main/java/iot/sixiang/license/controller/OperateController.java
View file @
a21ba397
...
...
@@ -112,6 +112,7 @@ public class OperateController {
public
BaseResult
readAlarm
()
{
String
i
=
UserUtils
.
getLoginUserId
();
int
uI
=
Integer
.
valueOf
(
i
);
uI
=
Integer
.
valueOf
(
XssUtil
.
checkXSS
(
String
.
valueOf
(
uI
)));
boolean
res
=
alarmReadService
.
readAlarm
(
uI
);
if
(
res
)
{
return
BaseResult
.
success
();
...
...
license/src/main/java/iot/sixiang/license/controller/ResourceContrller.java
View file @
a21ba397
...
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiOperation;
import
iot.sixiang.license.log.BusinessType
;
import
iot.sixiang.license.log.MyLog
;
import
iot.sixiang.license.resource.ResourceManager
;
import
iot.sixiang.license.xss.XssUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -29,6 +30,7 @@ public class ResourceContrller {
@MyLog
(
title
=
"下载资源"
,
optParam
=
"#{userId}"
,
businessType
=
BusinessType
.
OTHER
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户Id"
,
required
=
true
,
dataType
=
"int"
)
public
void
downloadWorkHourRecordTemplate
(
HttpServletResponse
response
,
@RequestParam
(
value
=
"userId"
)
int
userId
)
{
userId
=
Integer
.
valueOf
(
XssUtil
.
checkXSS
(
String
.
valueOf
(
userId
)));
resourceManager
.
downloadDeviceInfoExcle
(
response
,
userId
);
}
...
...
license/src/main/java/iot/sixiang/license/jwt/JwtFilter.java
View file @
a21ba397
...
...
@@ -2,6 +2,7 @@ package iot.sixiang.license.jwt;
import
com.auth0.jwt.interfaces.Claim
;
import
com.auth0.jwt.interfaces.DecodedJWT
;
import
iot.sixiang.license.xss.XssUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
javax.servlet.*
;
...
...
@@ -45,6 +46,7 @@ public class JwtFilter implements Filter {
if
(
uri
.
contains
(
url1
)
||
uri
.
contains
(
url2
)
||
uri
.
contains
(
url3
)
||
uri
.
contains
(
url4
)
||
uri
.
contains
(
url7
)
||
uri
.
contains
(
url8
))
{
if
(
uri
.
contains
(
url1
)
||
uri
.
contains
(
url2
))
{
uri
=
XssUtil
.
checkXSS
(
uri
);
UserUtils
.
setUri
(
uri
);
}
check
=
false
;
...
...
license/src/main/java/iot/sixiang/license/service/impl/AlarmReadServiceImpl.java
View file @
a21ba397
...
...
@@ -47,6 +47,7 @@ public class AlarmReadServiceImpl extends ServiceImpl<AlarmReadMapper, AlarmRead
int
typeId
=
alarm
.
getTypeId
();
String
title
=
alarm
.
getTitle
();
String
content
=
alarm
.
getContent
();
boolean
res
=
alarmReadMapper
.
readAlarm
(
alarmId
,
typeId
,
title
,
content
,
userId
);
if
(!
res
)
{
return
false
;
...
...
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