updates for meeting golint check.

This commit is contained in:
kunw 2016-06-16 14:26:33 +08:00
parent 255488157f
commit 853f3d91c9
2 changed files with 8 additions and 8 deletions

View File

@ -114,9 +114,9 @@ func (cc *CommonController) Render() error {
}
// Login handles login request from UI.
func (c *CommonController) Login() {
principal := c.GetString("principal")
password := c.GetString("password")
func (cc *CommonController) Login() {
principal := cc.GetString("principal")
password := cc.GetString("password")
user, err := auth.Login(models.AuthModel{
Principal: principal,
@ -124,15 +124,15 @@ func (c *CommonController) Login() {
})
if err != nil {
log.Errorf("Error occurred in UserLogin: %v", err)
c.CustomAbort(http.StatusUnauthorized, "")
cc.CustomAbort(http.StatusUnauthorized, "")
}
if user == nil {
c.CustomAbort(http.StatusUnauthorized, "")
cc.CustomAbort(http.StatusUnauthorized, "")
}
c.SetSession("userId", user.UserID)
c.SetSession("username", user.Username)
cc.SetSession("userId", user.UserID)
cc.SetSession("username", user.Username)
}
// LogOut Habor UI

View File

@ -8,7 +8,7 @@ import (
"github.com/vmware/harbor/utils/log"
)
// NavigationHeaderController handles requests to /navigation_detail
// NavigationDetailController handles requests to /navigation_detail
type NavigationDetailController struct {
BaseController
}