This commit is contained in:
aozhiwei 2024-07-24 16:27:51 +08:00
parent 2432f81b11
commit 525fac21b1
4 changed files with 47 additions and 0 deletions

View File

@ -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 + "?"

View File

@ -6,6 +6,7 @@ import (
)
var _serviceMgr = new(serviceMgr)
var SApiForward *sApiForward
func init() {
global.RegModule(constant.SERVICE_MGR_MODULE_IDX, _serviceMgr)

View 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) {
}

View File

@ -5,6 +5,7 @@ type serviceMgr struct {
func (this *serviceMgr) Init() {
}
func (this *serviceMgr) UnInit() {