Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
chenweijian
hilo-user
Commits
be03fcc6
Commit
be03fcc6
authored
Jun 25, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:分页兼容
parent
7d3b3319
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
response.go
resp/response.go
+11
-6
middleHandle.go
route/middleHandle.go
+4
-2
No files found.
resp/response.go
View file @
be03fcc6
...
...
@@ -38,7 +38,6 @@ func ResponseOk(c *gin.Context, data interface{}) {
Code
:
myerr
.
GetSuccessCode
(),
Message
:
myerr
.
GetSuccessMsg
(),
OperationMessage
:
myerr
.
GetSuccessMsg
(),
Data
:
data
,
// todo,3.9.0覆盖完整之后去掉
}
if
_
,
ok
:=
c
.
Get
(
mycontext
.
InnerEncrypt
);
ok
{
//response.Edata = utils.EncryptionData(data, []byte("484194d4d0f968a7"))
...
...
@@ -58,15 +57,21 @@ func ResponsePageBaseOk(c *gin.Context, data interface{}, nextPageIndex int, has
if
data
==
nil
{
data
=
make
([]
interface
{},
0
)
}
pageData
:=
req
.
PageRespBase
{
NextPageIndex
:
nextPageIndex
,
HasNextPage
:
hasNextPage
,
Data
:
data
,
}
response
:=
Response
{
Code
:
myerr
.
GetSuccessCode
(),
Message
:
myerr
.
GetSuccessMsg
(),
OperationMessage
:
myerr
.
GetSuccessMsg
(),
Data
:
req
.
PageRespBase
{
NextPageIndex
:
nextPageIndex
,
HasNextPage
:
hasNextPage
,
Data
:
data
,
},
}
if
_
,
ok
:=
c
.
Get
(
mycontext
.
InnerEncrypt
);
ok
{
//response.Edata = utils.EncryptionData(data, []byte("484194d4d0f968a7"))
response
.
Edata
=
utils
.
EncryptionData
(
pageData
,
[]
byte
(
"hilo!@#$%^&*()_+"
))
}
else
{
response
.
Data
=
pageData
}
c
.
JSON
(
http
.
StatusOK
,
response
)
}
...
...
route/middleHandle.go
View file @
be03fcc6
...
...
@@ -137,8 +137,10 @@ func LoggerHandle(c *gin.Context) {
// 加密Handle
func
EncryptHandle
(
c
*
gin
.
Context
)
{
if
value
,
ok
:=
c
.
Get
(
mycontext
.
APP_VERSION
);
ok
{
if
high
,
_
:=
utils
.
CompareVersion
(
value
.
(
string
),
"> 3.9.0"
);
high
{
header
:=
c
.
Request
.
Header
appVersion
:=
header
.
Get
(
"Appversion"
)
if
len
(
appVersion
)
>
0
{
if
high
,
_
:=
utils
.
CompareVersion
(
appVersion
,
"> 3.9.0"
);
high
{
c
.
Set
(
mycontext
.
InnerEncrypt
,
true
)
}
}
...
...
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