Commit e1d23d4f by huangchengyi

1.0

parent 2239aea7
......@@ -37,7 +37,7 @@ func GetDataIndex(c *gin.Context) {
return
}
common.PrintDebugHeader(c,&r.Flag)
common.PrintDebugHtml(c,&r.Flag,r.SupplierId)
common.PrintDebugHtml(c,&r.Flag,r.Keyword)
......
......@@ -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 flag 是否调试标志
......@@ -32,8 +40,6 @@ func PrintDebugHtml(ctx *gin.Context,flag *string,jsonStr interface{}) {
if *flag != "101" && jsonStr != "" {
return
}
ctx.Header("Content-Type", "text/html; charset=utf-8")
jsonData,err := json.Marshal(jsonStr)
if err != nil {
fmt.Println("错误:-----",err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment