50 lines
920 B
Go
50 lines
920 B
Go
package user
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/modules"
|
|
"go_dreamfactory/sys/configure"
|
|
cfg "go_dreamfactory/sys/configure/structs"
|
|
|
|
"github.com/liwei1dao/lego/core"
|
|
"github.com/liwei1dao/lego/sys/log"
|
|
)
|
|
|
|
func NewModule() core.IModule {
|
|
m := new(User)
|
|
return m
|
|
}
|
|
|
|
type User struct {
|
|
modules.ModuleBase
|
|
login_comp *LoginComp
|
|
}
|
|
|
|
func (this *User) GetType() core.M_Modules {
|
|
return comm.SM_LoginModule
|
|
}
|
|
|
|
func (this *User) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.login_comp = this.RegisterComp(new(LoginComp)).(*LoginComp)
|
|
}
|
|
|
|
func (this *Login) Start() (err error) {
|
|
|
|
if err = configure.RegisterConfigure("tbitem.json", cfg.NewTbItem); err != nil {
|
|
return
|
|
}
|
|
|
|
if data, ret := configure.GetConfigure("tbitem.json"); ret == nil {
|
|
_data := data.(*cfg.TbItem).GetDataMap()
|
|
for _, v := range _data {
|
|
if v.Id > 0 {
|
|
break
|
|
}
|
|
log.Debugf(v.Name)
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|