mirror of
https://github.com/eolinker/apinto
synced 2025-10-05 00:42:47 +08:00
修改获取随机字符串的方法
This commit is contained in:
@@ -3,7 +3,7 @@ package http_context
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"github.com/eolinker/goku-eosc/utils"
|
||||
|
||||
"github.com/valyala/fasthttp"
|
||||
|
||||
@@ -27,14 +27,12 @@ type Context struct {
|
||||
|
||||
//NewContext 创建Context
|
||||
func NewContext(ctx *fasthttp.RequestCtx) *Context {
|
||||
id := uuid.NewV4()
|
||||
requestID := id.String()
|
||||
newRequest := &ctx.Request
|
||||
newCtx := &Context{
|
||||
context: ctx,
|
||||
requestOrg: fasthttp.AcquireRequest(),
|
||||
proxyRequest: fasthttp.AcquireRequest(),
|
||||
requestID: requestID,
|
||||
requestID: utils.GetRandomString(16),
|
||||
LogFields: access_field.NewFields(),
|
||||
}
|
||||
newRequest.CopyTo(newCtx.requestOrg)
|
||||
|
Reference in New Issue
Block a user