|
@@ -27,16 +27,7 @@ type ResultData struct {
|
|
|
|
|
|
func result(code int, resultData ResultData, c *gin.Context) {
|
|
func result(code int, resultData ResultData, c *gin.Context) {
|
|
jsonByte, _ := json.Marshal(resultData)
|
|
jsonByte, _ := json.Marshal(resultData)
|
|
- token := c.Request.Header.Get("Authorization")
|
|
|
|
- if token == "" {
|
|
|
|
- token = c.DefaultQuery("authorization", "")
|
|
|
|
- if token == "" {
|
|
|
|
- token = c.DefaultQuery("Authorization", "")
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- logSlice := make([]string, 0)
|
|
|
|
- logSlice = append(logSlice, fmt.Sprint("Url:", c.Request.RequestURI))
|
|
|
|
- logSlice = append(logSlice, fmt.Sprint("Token:", token))
|
|
|
|
|
|
+ logSlice := utils.GetBridgeLogListByClaims(c)
|
|
logSlice = append(logSlice, fmt.Sprint("resultData:", string(jsonByte)))
|
|
logSlice = append(logSlice, fmt.Sprint("resultData:", string(jsonByte)))
|
|
|
|
|
|
//记录错误日志
|
|
//记录错误日志
|
|
@@ -44,13 +35,12 @@ func result(code int, resultData ResultData, c *gin.Context) {
|
|
logSlice = append(logSlice, fmt.Sprint("ErrMsg:", resultData.ErrMsg))
|
|
logSlice = append(logSlice, fmt.Sprint("ErrMsg:", resultData.ErrMsg))
|
|
//global.LOG.Info(strings.Join(logSlice, ";"))
|
|
//global.LOG.Info(strings.Join(logSlice, ";"))
|
|
}
|
|
}
|
|
|
|
+ global.LOG.Info(strings.Join(logSlice, "\n"))
|
|
|
|
|
|
// 测试环境不加密
|
|
// 测试环境不加密
|
|
if global.CONFIG.Serve.RunMode == "debug" {
|
|
if global.CONFIG.Serve.RunMode == "debug" {
|
|
- global.LOG.Info(strings.Join(logSlice, ";"))
|
|
|
|
c.JSON(code, resultData)
|
|
c.JSON(code, resultData)
|
|
} else {
|
|
} else {
|
|
- global.LOG.Info(strings.Join(logSlice, ";"))
|
|
|
|
encryptResult := utils.DesBase64Encrypt(jsonByte)
|
|
encryptResult := utils.DesBase64Encrypt(jsonByte)
|
|
c.JSON(code, string(encryptResult))
|
|
c.JSON(code, string(encryptResult))
|
|
}
|
|
}
|