beego框架panic: 'GetSecurityInf' method doesn't exist in the controller CorporateInfcontroller问题解决

在使用beego框架时,出现类似于panic: 'GetSecurityInf' method doesn't exist in the controller CorporateInfcontroller的错误时,问题出在相应的路由设置routers里。

正确代码如下:

beego.Router("/getsecurityinf", &controllers.SecurityInfcontroller{}, "*:GetSecurityInf")

若在编程时错误输入以下代码,则会报以上错误:

beego.Router("/getsecurityinf", &controllers.CorporateInfcontroller{}, "*:GetSecurityInf")

一般出现此错误的原因在于复制粘贴时没有修改相应的controller.

猜你喜欢

转载自www.cnblogs.com/zheng123/p/8856274.html