Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e1d23d4f
authored
Jul 24, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
2239aea7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
controller/get_data_controller.go
pkg/common/function.go
controller/get_data_controller.go
View file @
e1d23d4f
...
@@ -37,7 +37,7 @@ func GetDataIndex(c *gin.Context) {
...
@@ -37,7 +37,7 @@ func GetDataIndex(c *gin.Context) {
return
return
}
}
common
.
PrintDebugHeader
(
c
,
&
r
.
Flag
)
common
.
PrintDebugHtml
(
c
,
&
r
.
Flag
,
r
.
SupplierId
)
common
.
PrintDebugHtml
(
c
,
&
r
.
Flag
,
r
.
SupplierId
)
common
.
PrintDebugHtml
(
c
,
&
r
.
Flag
,
r
.
Keyword
)
common
.
PrintDebugHtml
(
c
,
&
r
.
Flag
,
r
.
Keyword
)
...
...
pkg/common/function.go
View file @
e1d23d4f
...
@@ -22,6 +22,14 @@ import (
...
@@ -22,6 +22,14 @@ import (
)
)
/*
/*
输出header
*/
func
PrintDebugHeader
(
ctx
*
gin
.
Context
,
flag
*
string
)
{
if
*
flag
==
"101"
{
ctx
.
Header
(
"Content-Type"
,
"text/html; charset=utf-8"
)
}
}
/*
格式化数据直接输出浏览器
格式化数据直接输出浏览器
@parm ctx gin上下文
@parm ctx gin上下文
@parm flag 是否调试标志
@parm flag 是否调试标志
...
@@ -32,8 +40,6 @@ func PrintDebugHtml(ctx *gin.Context,flag *string,jsonStr interface{}) {
...
@@ -32,8 +40,6 @@ func PrintDebugHtml(ctx *gin.Context,flag *string,jsonStr interface{}) {
if
*
flag
!=
"101"
&&
jsonStr
!=
""
{
if
*
flag
!=
"101"
&&
jsonStr
!=
""
{
return
return
}
}
ctx
.
Header
(
"Content-Type"
,
"text/html; charset=utf-8"
)
jsonData
,
err
:=
json
.
Marshal
(
jsonStr
)
jsonData
,
err
:=
json
.
Marshal
(
jsonStr
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
"错误:-----"
,
err
)
fmt
.
Println
(
"错误:-----"
,
err
)
...
...
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