- refactor weixin and mini program login

This commit is contained in:
gazebo
2019-01-26 16:02:01 +08:00
parent ab53a4b61d
commit aba16383fe
10 changed files with 284 additions and 116 deletions

View File

@@ -20,17 +20,17 @@ func init() {
auth.RegisterAuther(LoginType, new(Auther))
}
func (a *Auther) Login(uname, password string) (userID string, err error) {
func (a *Auther) Login(uname, password string) (userID, LoginType 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(loginInfo *auth.LoginInfo) error {