|
|
|
@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
import com.ruoyi.common.core.domain.R;
|
|
|
|
|
import com.ruoyi.common.core.text.Convert;
|
|
|
|
|
import com.ruoyi.common.core.utils.DateUtils;
|
|
|
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
|
|
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
|
@ -189,6 +190,7 @@ public class SysUserController extends BaseController
|
|
|
|
|
ajax.put("roles", roles);
|
|
|
|
|
ajax.put("permissions", permissions);
|
|
|
|
|
ajax.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
|
|
|
|
ajax.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
|
|
|
|
return ajax;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -199,6 +201,23 @@ public class SysUserController extends BaseController
|
|
|
|
|
return initPasswordModify != null && initPasswordModify == 1 && pwdUpdateDate == null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查密码是否过期
|
|
|
|
|
public boolean passwordIsExpiration(Date pwdUpdateDate)
|
|
|
|
|
{
|
|
|
|
|
Integer passwordValidateDays = Convert.toInt(configService.selectConfigByKey("sys.account.passwordValidateDays"));
|
|
|
|
|
if (passwordValidateDays != null && passwordValidateDays > 0)
|
|
|
|
|
{
|
|
|
|
|
if (StringUtils.isNull(pwdUpdateDate))
|
|
|
|
|
{
|
|
|
|
|
// 如果从未修改过初始密码,直接提醒过期
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
Date nowDate = DateUtils.getNowDate();
|
|
|
|
|
return DateUtils.differentDaysByMillisecond(nowDate, pwdUpdateDate) > passwordValidateDays;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据用户编号获取详细信息
|
|
|
|
|
*/
|
|
|
|
|