1、增加了登录后重定向至原始请求 URL 的功能;2、格式化了相关文件中的代码。

This commit is contained in:
Dandy Cheung
2018-01-09 18:15:40 +08:00
parent d0a1c77c43
commit 4ff6be3b6c
3 changed files with 191 additions and 151 deletions

View File

@@ -99,6 +99,11 @@ func isUserLoggedIn(c *DocumentController) bool {
}
func promptUserToLogIn(c *DocumentController) {
beego.Info("Access " + c.Ctx.Request.URL.RequestURI() + " not permitted.")
beego.Info(" Access will be redirected to login page(SessionId: " + c.CruSession.SessionID() + ").")
c.SetSession("turl", c.Ctx.Request.URL.RequestURI())
if c.IsAjax() {
c.JsonResult(6000, "需要[重]登录。")
} else {