UpdateUserPassword 更新用户密码
(user, passwd string)
| 147 | |
| 148 | // UpdateUserPassword 更新用户密码 |
| 149 | func (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 需要把返回字符串修改成对应的类型 |
nothing calls this directly
no test coverage detected