- mini program login

This commit is contained in:
gazebo
2018-12-27 16:49:32 +08:00
parent b1a7cfdaa8
commit 5adc5e61f3
16 changed files with 301 additions and 51 deletions

View File

@@ -20,19 +20,19 @@ func init() {
auth.RegisterAuther(LoginType, new(Auther))
}
func (a *Auther) Login(uname, password string) (err error) {
func (a *Auther) Login(uname, password string) (userID string, err error) {
user := &legacymodel.JxBackendUser{
UName: uname,
}
if err = dao.GetEntity(nil, user, "UName"); err == nil {
if fmt.Sprintf("%x", md5.Sum([]byte(password))) == user.UPass {
return nil
return "", nil
}
err = auth.ErrUIDAndPassNotMatch
}
return err
return "", err
}
func (a *Auther) Logout(openid string) error {
func (a *Auther) Logout(loginInfo *auth.LoginInfo) error {
return nil
}