Commit 7b76392f by zhengyunfei

轮播图添加启用停用和删除状态

parent ba0fb6e6
......@@ -54,7 +54,7 @@ public class SysLoginController {
Map<String, Object> ajax = new HashMap<>();
SysUser sysUser = userService.selectUserByUserName(loginBody.getUsername());
if(null!=sysUser && sysUser.getSex().equals("0")){
throw new SecurityException("请填写正确老师账号");
throw new SecurityException("账户密码有误");
}
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
......
......@@ -16,6 +16,7 @@ import com.ruoyi.common.core.domain.model.XcxLoginUser;
import com.ruoyi.common.enums.DeviceType;
import com.ruoyi.common.enums.LoginType;
import com.ruoyi.common.enums.UserStatus;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.CaptchaExpireException;
import com.ruoyi.common.exception.user.UserException;
......@@ -176,11 +177,11 @@ public class SysLoginService {
RedisUtils.deleteObject(verifyKey);
if (captcha == null) {
recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
throw new CaptchaExpireException();
throw new ServiceException("验证码无效");
}
if (!code.equalsIgnoreCase(captcha)) {
recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
throw new CaptchaException();
throw new ServiceException("验证码无效");
}
}
......@@ -190,10 +191,10 @@ public class SysLoginService {
.eq(SysUser::getUserName, username));
if (ObjectUtil.isNull(user)) {
log.info("登录用户:{} 不存在.", username);
throw new UserException("user.not.exists", username);
throw new UserException("登录用户:{} 不存在.", username);
} else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
log.info("登录用户:{} 已被停用.", username);
throw new UserException("user.blocked", username);
throw new UserException("登录用户:{} 已被停用.", username);
}
return userMapper.selectUserByUserName(username);
}
......
......@@ -40,8 +40,12 @@ public class DbBanner extends BaseEntity {
*/
private String remark;
/**
* 状态:0正常,1删除
* 状态:0正常,1停用
*/
private Integer status;
/**
* 删除状态:0正常,1删除
*/
private Integer delFlag;
}
......@@ -46,10 +46,15 @@ public class DbBannerBo extends BaseEntity {
private String remark;
/**
* 状态:0正常,1删除
* 状态:0正常,1停用
*/
// @NotNull(message = "状态:0正常,1删除不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer status;
/**
* 删除状态:0正常,1删除
*/
private Integer delFlag;
}
......@@ -46,10 +46,15 @@ public class DbBannerVo {
private String remark;
/**
* 状态:0正常,1删除
* 状态:0正常,1停用
*/
@ExcelProperty(value = "状态:0正常,1删除")
@ExcelProperty(value = "状态:0正常,1停用")
private Integer status;
/**
* 删除状态:0正常,1删除
*/
@ExcelProperty(value = "删除状态:0正常,1删除")
private Integer delFlag;
}
......@@ -50,6 +50,7 @@ public class DbBannerServiceImpl implements IDbBannerService {
*/
@Override
public TableDataInfo<DbBannerVo> queryPageList(DbBannerBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<DbBanner> lqw = buildQueryWrapper(bo);
Page<DbBannerVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
......@@ -70,6 +71,7 @@ public class DbBannerServiceImpl implements IDbBannerService {
lqw.eq(StringUtils.isNotBlank(bo.getBannerTitle()), DbBanner::getBannerTitle, bo.getBannerTitle());
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), DbBanner::getUrl, bo.getUrl());
lqw.eq(bo.getStatus() != null, DbBanner::getStatus, bo.getStatus());
lqw.eq(DbBanner::getDelFlag, 0);
return lqw;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment