dongyun65343 2019-09-13 09:06
浏览 306

Beego POST方法总是寻找模板文件

I am writing a simple login/logout feature using Beego.

My init() in router.go file is given below:

func init() {
    beego.Router("/", &controllers.MainController{})
    beego.Router("/login", &controllers.AuthController{})
    beego.Router("/verify", &controllers.AuthController{}, "post:Verify")
}

In AuthController:

func (c *AuthController) Verify() {
    email := c.GetString("email")
    password := c.GetString("password")

    fmt.Printf("email: %v password: %v", email, password)
}

I just want to print the details to browser (for debugging purpose) and later redirect it to another page if the user is authenticated. But the issue here is that Beego always looks for a template file and throws the below error:

can't find templatefile in the path:views/authcontroller/verify.tpl

How can I stop Beego from acting like that or am I doing something that is "not-beego-like"?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Jenkins+k8s部署slave节点offline
    • ¥15 微信小游戏反编译后,出现找不到分包的情况
    • ¥15 如何实现从tello无人机上获取实时传输的视频流,然后将获取的视频通过yolov5进行检测
    • ¥15 WPF使用Canvas绘制矢量图问题
    • ¥15 用三极管设计一个单管共射放大电路
    • ¥15 孟德尔随机化r语言运行问题
    • ¥15 pyinstaller编译的时候出现No module named 'imp'
    • ¥15 nirs_kit中打码怎么看(打码文件是csv格式)
    • ¥15 怎么把多于硬盘空间放到根目录下
    • ¥15 Matlab问题解答有两个问题