fix(login): judging ldap_enable logic error

review: https://github.com/mindoc-org/mindoc/pull/662#discussion_r603750715
pull/662/head
roberChen 2021-03-30 11:45:56 +08:00
parent 94c233c03a
commit bdaeefc784
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -25,6 +25,7 @@ database
*.test *.test
*.prof *.prof
.idea .idea
.vscode
/conf/app.conf /conf/app.conf
/vendor /vendor
/runtime /runtime

View File

@ -114,8 +114,8 @@ func RunMigration() {
//导出数据库的表结构 //导出数据库的表结构
func ExportDatabaseTable() ([]string, error) { func ExportDatabaseTable() ([]string, error) {
dbadapter,_ := web.AppConfig.String("db_adapter") dbadapter, _ := web.AppConfig.String("db_adapter")
dbdatabase,_ := web.AppConfig.String("db_database") dbdatabase, _ := web.AppConfig.String("db_database")
tables := make([]string, 0) tables := make([]string, 0)
o := orm.NewOrm() o := orm.NewOrm()

View File

@ -118,7 +118,7 @@ func (m *Member) TmpLogin(account string) (*Member, error) {
//ldapLogin 通过LDAP登陆 //ldapLogin 通过LDAP登陆
func (m *Member) ldapLogin(account string, password string) (*Member, error) { func (m *Member) ldapLogin(account string, password string) (*Member, error) {
if web.AppConfig.DefaultBool("ldap_enable", false) { if !web.AppConfig.DefaultBool("ldap_enable", false) {
return m, ErrMemberAuthMethodInvalid return m, ErrMemberAuthMethodInvalid
} }
var err error var err error