1
This commit is contained in:
parent
2432f81b11
commit
525fac21b1
@ -5,6 +5,7 @@ import (
|
||||
"mt"
|
||||
"net/http"
|
||||
"q5"
|
||||
"main/service"
|
||||
"jccommon"
|
||||
"io/ioutil"
|
||||
"bytes"
|
||||
@ -21,9 +22,16 @@ func CaForward(c *gin.Context) {
|
||||
if !jccommon.IsValidSessionId(accountId, sessionId) {
|
||||
f5.RspErr(c, 500, "invalid session_id")
|
||||
c.Abort()
|
||||
service.SApiForward.IncInvalidSessionTimes()
|
||||
return
|
||||
}
|
||||
|
||||
service.SApiForward.IncTotalTimes()
|
||||
beginTick := q5.GetTickCount()
|
||||
defer func() {
|
||||
costTime := q5.GetTickCount() - beginTick
|
||||
service.SApiForward.UpdateCostTime(costTime)
|
||||
}()
|
||||
newUrl := mt.Table.Config.GetById(0).GetRedirectUrl() + c.Request.URL.Path[5:]
|
||||
if !q5.StrContains(newUrl, "?") {
|
||||
newUrl = newUrl + "?"
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
)
|
||||
|
||||
var _serviceMgr = new(serviceMgr)
|
||||
var SApiForward *sApiForward
|
||||
|
||||
func init() {
|
||||
global.RegModule(constant.SERVICE_MGR_MODULE_IDX, _serviceMgr)
|
||||
|
37
server/gamesapi/service/sapi_forward.go
Normal file
37
server/gamesapi/service/sapi_forward.go
Normal file
@ -0,0 +1,37 @@
|
||||
package service
|
||||
|
||||
type sApiForward struct {
|
||||
|
||||
}
|
||||
|
||||
func (this *sApiForward) IncInvalidSessionTimes() {
|
||||
|
||||
}
|
||||
|
||||
func (this *sApiForward) IncTotalTimes() {
|
||||
|
||||
}
|
||||
|
||||
func (this *sApiForward) IncGetTimes() {
|
||||
|
||||
}
|
||||
|
||||
func (this *sApiForward) IncPostTimes() {
|
||||
|
||||
}
|
||||
|
||||
func (this *sApiForward) IncCreateErrTimes() {
|
||||
|
||||
}
|
||||
|
||||
func (this *sApiForward) IncDoErrTimes() {
|
||||
|
||||
}
|
||||
|
||||
func (this *sApiForward) IncReadRspErrTimes() {
|
||||
|
||||
}
|
||||
|
||||
func (this *sApiForward) UpdateCostTime(costTime int64) {
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ type serviceMgr struct {
|
||||
|
||||
func (this *serviceMgr) Init() {
|
||||
|
||||
}
|
||||
|
||||
func (this *serviceMgr) UnInit() {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user