Skip to content

Commit

Permalink
chore(member): add debug info print
Browse files Browse the repository at this point in the history
  • Loading branch information
roberChen committed Mar 25, 2021
1 parent 2d05b5a commit 4e243e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions commands/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ func initialization() {
member, err := models.NewMember().FindByFieldFirst("account", "admin")
if err == orm.ErrNoRows {

// create admin user
logs.Info("creating admin user")
member.Account = "admin"
member.Avatar = conf.URLForWithCdnImage("/static/images/headimgurl.jpg")
member.Password = "123456"
Expand All @@ -114,6 +116,8 @@ func initialization() {
panic("Member.Add => " + err.Error())
}

// create demo book
logs.Info("creating demo book")
book := models.NewBook()

book.MemberId = member.MemberId
Expand Down
2 changes: 1 addition & 1 deletion models/Member.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (m *Member) Login(account string, password string) (*Member, error) {
logs.Info("转入 HTTP 接口登陆 ->", account)
return member.httpLogin(account, password)
} else {
logs.Error("用户登录 ->", err)
logs.Error("user login for `%s`: %s",account, err)
return member, ErrMemberNoExist
}
}
Expand Down

0 comments on commit 4e243e2

Please sign in to comment.