- fullfill ChangePassword
This commit is contained in:
@@ -20,12 +20,17 @@ type Auther struct {
|
||||
authprovider.DefAuther
|
||||
}
|
||||
|
||||
var (
|
||||
AutherObj *Auther
|
||||
)
|
||||
|
||||
var (
|
||||
ErrUserAndPassNotMatch = errors.New("用户名密码不匹配")
|
||||
)
|
||||
|
||||
func init() {
|
||||
auth2.RegisterAuther(AuthType, new(Auther))
|
||||
AutherObj = new(Auther)
|
||||
auth2.RegisterAuther(AuthType, AutherObj)
|
||||
}
|
||||
|
||||
func (a *Auther) VerifySecret(userID, passMD5 string) (authBind *model.AuthBind, err error) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/password"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/auth"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
@@ -194,6 +195,10 @@ func (c *Auth2Controller) RemoveAuthBind() {
|
||||
// @router /ChangePassword [put]
|
||||
func (c *Auth2Controller) ChangePassword() {
|
||||
c.callChangePassword(func(params *tAuth2ChangePasswordParams) (retVal interface{}, errCode string, err error) {
|
||||
authInfo, err := c.getAuth2Info(params.Ctx)
|
||||
if err == nil {
|
||||
err = password.AutherObj.ChangePassword(authInfo.GetID(), params.OldPwd, params.NewPwd)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user