mirror of https://github.com/mindoc-org/mindoc.git
chore(member): add debug info print
parent
2d05b5a80f
commit
4e243e2d70
|
@ -103,6 +103,8 @@ func initialization() {
|
||||||
member, err := models.NewMember().FindByFieldFirst("account", "admin")
|
member, err := models.NewMember().FindByFieldFirst("account", "admin")
|
||||||
if err == orm.ErrNoRows {
|
if err == orm.ErrNoRows {
|
||||||
|
|
||||||
|
// create admin user
|
||||||
|
logs.Info("creating admin user")
|
||||||
member.Account = "admin"
|
member.Account = "admin"
|
||||||
member.Avatar = conf.URLForWithCdnImage("/static/images/headimgurl.jpg")
|
member.Avatar = conf.URLForWithCdnImage("/static/images/headimgurl.jpg")
|
||||||
member.Password = "123456"
|
member.Password = "123456"
|
||||||
|
@ -114,6 +116,8 @@ func initialization() {
|
||||||
panic("Member.Add => " + err.Error())
|
panic("Member.Add => " + err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create demo book
|
||||||
|
logs.Info("creating demo book")
|
||||||
book := models.NewBook()
|
book := models.NewBook()
|
||||||
|
|
||||||
book.MemberId = member.MemberId
|
book.MemberId = member.MemberId
|
||||||
|
|
|
@ -81,7 +81,7 @@ func (m *Member) Login(account string, password string) (*Member, error) {
|
||||||
logs.Info("转入 HTTP 接口登陆 ->", account)
|
logs.Info("转入 HTTP 接口登陆 ->", account)
|
||||||
return member.httpLogin(account, password)
|
return member.httpLogin(account, password)
|
||||||
} else {
|
} else {
|
||||||
logs.Error("用户登录 ->", err)
|
logs.Error("user login for `%s`: %s",account, err)
|
||||||
return member, ErrMemberNoExist
|
return member, ErrMemberNoExist
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue