修改密码
This commit is contained in:
parent
548494822a
commit
99a8b5124c
|
|
@ -84,4 +84,10 @@ public interface RemoteUserService
|
||||||
*/
|
*/
|
||||||
@GetMapping("/user/getUserList")
|
@GetMapping("/user/getUserList")
|
||||||
public R<List<SysUser>> getUserList(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
public R<List<SysUser>> getUserList(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询密码是否需要修改
|
||||||
|
*/
|
||||||
|
@GetMapping("/user/userPwdState")
|
||||||
|
public String userPwdState(String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,11 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||||
public R<List<SysUser>> getUserList(SysUser sysUser, String source) {
|
public R<List<SysUser>> getUserList(SysUser sysUser, String source) {
|
||||||
return R.fail("获取用户失败:" + throwable.getMessage());
|
return R.fail("获取用户失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String userPwdState(String username, String source) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,14 @@ public class LoginUser implements Serializable
|
||||||
*/
|
*/
|
||||||
private Set<String> roles;
|
private Set<String> roles;
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -77,6 +85,16 @@ public class LoginUser implements Serializable
|
||||||
*/
|
*/
|
||||||
private String loginMethod;
|
private String loginMethod;
|
||||||
|
|
||||||
|
public String getForceChangePwd() {
|
||||||
|
return forceChangePwd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setForceChangePwd(String forceChangePwd) {
|
||||||
|
this.forceChangePwd = forceChangePwd;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String forceChangePwd;
|
||||||
|
|
||||||
public String getLoginMethod() {
|
public String getLoginMethod() {
|
||||||
return loginMethod;
|
return loginMethod;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,14 +93,9 @@ public class SysLoginService {
|
||||||
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
||||||
}
|
}
|
||||||
passwordService.validate(user, password);
|
passwordService.validate(user, password);
|
||||||
|
|
||||||
// 检查用户是否需要更改初始密码
|
|
||||||
if (user.getForceChangePwd().equals(1)) {
|
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "请先修改初始密码");
|
|
||||||
throw new ServiceException("请先修改初始密码");
|
|
||||||
}
|
|
||||||
|
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
|
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
|
||||||
|
String forceChangePwd = remoteUserService.userPwdState(username,SecurityConstants.INNER);
|
||||||
|
userInfo.setForceChangePwd(forceChangePwd);
|
||||||
return userInfo;
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,12 @@ public class SysUserController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/userPwdState")
|
||||||
|
public String userPwdState(String username) {
|
||||||
|
startPage();
|
||||||
|
String state = userService.selectforceChangePwd(username);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 获取用户列表内部请求
|
* 获取用户列表内部请求
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -134,4 +134,6 @@ public interface SysUserMapper
|
||||||
List<SysUser> selectUserByRole(SysUser sysUser);
|
List<SysUser> selectUserByRole(SysUser sysUser);
|
||||||
|
|
||||||
void updatePurchaseNoticePerson(SysUser user);
|
void updatePurchaseNoticePerson(SysUser user);
|
||||||
|
|
||||||
|
String selectforceChangePwd(String username);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -224,4 +224,6 @@ public interface ISysUserService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult urgentProcessingUser(UrgentProcessingUser urgentProcessingUser);
|
AjaxResult urgentProcessingUser(UrgentProcessingUser urgentProcessingUser);
|
||||||
|
|
||||||
|
String selectforceChangePwd(String username);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -575,4 +575,9 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
log.info("ToDoServiceImpl urgentProcessingUser {} end" ,urgentProcessingUser);
|
log.info("ToDoServiceImpl urgentProcessingUser {} end" ,urgentProcessingUser);
|
||||||
return success(userList);
|
return success(userList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String selectforceChangePwd(String username) {
|
||||||
|
return userMapper.selectforceChangePwd(username);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectforceChangePwd" resultType="java.lang.String">
|
||||||
|
select force_change_pwd from sys_user where user_name = #{username}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertUser" parameterType="com.bonus.sgzb.system.api.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
<insert id="insertUser" parameterType="com.bonus.sgzb.system.api.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||||
insert into sys_user(
|
insert into sys_user(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue