mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-04-05 20:17:53 +08:00
chore(member): add debug info print
This commit is contained in:
parent
2d05b5a80f
commit
4e243e2d70
@ -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"
|
||||
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user