MCPcopy Create free account
hub / github.com/dearcode/candy / UpdateUserPassword

Method UpdateUserPassword

client/candy.go:149–165  ·  view source on GitHub ↗

UpdateUserPassword 更新用户密码

(user, passwd string)

Source from the content-addressed store, hash-verified

147
148// UpdateUserPassword 更新用户密码
149func (c *CandyClient) UpdateUserPassword(user, passwd string) (int64, error) {
150 if code, err := CheckUserName(user); err != nil {
151 return -1, NewError(code, err.Error())
152 }
153
154 if code, err := CheckUserPassword(passwd); err != nil {
155 return -1, NewError(code, err.Error())
156 }
157
158 req := &meta.GateUpdateUserPasswordRequest{User: user, Password: passwd}
159 resp, err := c.api.UpdateUserPassword(context.Background(), req)
160 if err != nil {
161 return -1, err
162 }
163
164 return resp.ID, resp.Header.Error()
165}
166
167// GetUserInfoByName 根据用户名获取用户信息
168//TODO 需要把返回字符串修改成对应的类型

Callers

nothing calls this directly

Calls 5

CheckUserNameFunction · 0.85
NewErrorFunction · 0.85
CheckUserPasswordFunction · 0.85
UpdateUserPasswordMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected