|  |  |  | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.biz.system.SystemUserBiz; | 
|---|
|  |  |  | import com.doumee.core.annotation.trace.Trace; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.system.dto.UpdatePwdDto; | 
|---|
|  |  |  | import com.doumee.service.system.SystemLoginService; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Trace(exclude = true) | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/cloudService/system") | 
|---|
|  |  |  | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/system") | 
|---|
|  |  |  | public class SystemCloudController extends BaseController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("修改当前用户密码") | 
|---|
|  |  |  | @PostMapping("/updatePwd") | 
|---|
|  |  |  | public ApiResponse updatePwd (@RequestHeader(Constants.HEADER_USER_TOKEN) String token, @Validated @RequestBody UpdatePwdDto dto) { | 
|---|
|  |  |  | dto.setUserId(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | LoginUserInfo userInfo = this.getLoginUser(token); | 
|---|
|  |  |  | dto.setUserId(userInfo.getId()); | 
|---|
|  |  |  | dto.setToken(token); | 
|---|
|  |  |  | dto.setLoginUserInfo(userInfo); | 
|---|
|  |  |  | systemUserBiz.updatePwd(dto); | 
|---|
|  |  |  | userInfo.setNeedChangePwd(Constants.ONE); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|