mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 20:00:55 +00:00
improve main login performance
This commit is contained in:
parent
bc0d4ac7cb
commit
7242bc862e
23
router.go
23
router.go
@ -709,9 +709,26 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
|||||||
|
|
||||||
if !w.started {
|
if !w.started {
|
||||||
//exec main logic
|
//exec main logic
|
||||||
in := make([]reflect.Value, 0)
|
switch runMethod {
|
||||||
method := vc.MethodByName(runMethod)
|
case "Get":
|
||||||
method.Call(in)
|
execController.Get()
|
||||||
|
case "Post":
|
||||||
|
execController.Post()
|
||||||
|
case "Delete":
|
||||||
|
execController.Delete()
|
||||||
|
case "Put":
|
||||||
|
execController.Put()
|
||||||
|
case "Head":
|
||||||
|
execController.Head()
|
||||||
|
case "Patch":
|
||||||
|
execController.Patch()
|
||||||
|
case "Options":
|
||||||
|
execController.Options()
|
||||||
|
default:
|
||||||
|
in := make([]reflect.Value, 0)
|
||||||
|
method := vc.MethodByName(runMethod)
|
||||||
|
method.Call(in)
|
||||||
|
}
|
||||||
|
|
||||||
//render template
|
//render template
|
||||||
if !w.started && !context.Input.IsWebsocket() {
|
if !w.started && !context.Input.IsWebsocket() {
|
||||||
|
Loading…
Reference in New Issue
Block a user