v1.0 use revel 0.12

This commit is contained in:
lealife
2015-06-15 19:13:00 +08:00
parent 04c339896b
commit ab4b8b77a3
9 changed files with 18 additions and 82 deletions

@ -85,8 +85,14 @@ func (c Auth) Logout() revel.Result {
// 体验一下
func (c Auth) Demo() revel.Result {
c.doLogin(configService.GetGlobalStringConfig("demoUsername"), configService.GetGlobalStringConfig("demoPassword"))
return c.Redirect("/note")
email := configService.GetGlobalStringConfig("demoPassword")
pwd := configService.GetGlobalStringConfig("demoPassword");
userInfo := authService.Login(email, pwd)
if userInfo.Email != "" {
c.SetSession(userInfo)
return c.Redirect("/note")
}
return nil
}
//--------