diff --git a/src/main/java/io/linfeng/common/utils/Constant.java b/src/main/java/io/linfeng/common/utils/Constant.java index 6cdcb23..556858f 100644 --- a/src/main/java/io/linfeng/common/utils/Constant.java +++ b/src/main/java/io/linfeng/common/utils/Constant.java @@ -52,6 +52,9 @@ public class Constant { public static final Integer USER_NORMAL = 0; public static final Integer USER_BANNER = 1; + public static final String USER_BANNER_MSG = "该账号已被禁用"; + + /** diff --git a/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java b/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java index c7f8d3b..bd5e657 100644 --- a/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java +++ b/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java @@ -101,8 +101,8 @@ public class AppUserServiceImpl extends ServiceImpl i @Transactional(rollbackFor = Exception.class) public void ban(Integer id) { Integer status = this.lambdaQuery().eq(AppUserEntity::getUid, id).one().getStatus(); - if (status.equals(Constant.USER_BANNER)) { - throw new LinfengException("该用户已被禁用"); + if(status.equals(Constant.USER_BANNER)){ + throw new LinfengException(Constant.USER_BANNER_MSG); } this.lambdaUpdate() .set(AppUserEntity::getStatus, Constant.USER_BANNER) @@ -116,7 +116,7 @@ public class AppUserServiceImpl extends ServiceImpl i public void openBan(Integer id) { Integer status = this.lambdaQuery().eq(AppUserEntity::getUid, id).one().getStatus(); if (status.equals(Constant.USER_NORMAL)) { - throw new LinfengException("该用户已解除禁用"); + throw new LinfengException(Constant.USER_BANNER_MSG); } boolean update = this.lambdaUpdate() .set(AppUserEntity::getStatus, Constant.USER_NORMAL) @@ -165,7 +165,7 @@ public class AppUserServiceImpl extends ServiceImpl i if (ObjectUtil.isNotNull(appUserEntity)) { //登录 if (appUserEntity.getStatus().equals(Constant.USER_BANNER)) { - throw new LinfengException("该账户已被禁用"); + throw new LinfengException(Constant.USER_BANNER_MSG); } return appUserEntity.getUid(); } else { @@ -330,8 +330,8 @@ public class AppUserServiceImpl extends ServiceImpl i .eq(AppUserEntity::getOpenid, openId) .one(); if (ObjectUtil.isNotNull(user)) { - if (user.getStatus() .equals(Constant.USER_BANNER)) { - throw new LinfengException("该账户已被禁用"); + if(user.getStatus().equals(Constant.USER_BANNER)){ + throw new LinfengException(Constant.USER_BANNER_MSG); } //其他业务todo return user.getUid(); diff --git a/src/main/java/io/linfeng/modules/admin/service/impl/PostServiceImpl.java b/src/main/java/io/linfeng/modules/admin/service/impl/PostServiceImpl.java index 2d9a8a4..7bf1698 100644 --- a/src/main/java/io/linfeng/modules/admin/service/impl/PostServiceImpl.java +++ b/src/main/java/io/linfeng/modules/admin/service/impl/PostServiceImpl.java @@ -202,7 +202,7 @@ public class PostServiceImpl extends ServiceImpl implements @Transactional(rollbackFor = Exception.class) public void addComment(AddCommentForm request, AppUserEntity user) { if(user.getStatus().equals(Constant.USER_BANNER)){ - throw new LinfengException("您的账号已被禁用!"); + throw new LinfengException(Constant.USER_BANNER_MSG); } CommentEntity commentEntity=new CommentEntity(); @@ -217,8 +217,8 @@ public class PostServiceImpl extends ServiceImpl implements @Override @Transactional(rollbackFor = Exception.class) public Integer addPost(AddPostForm request, AppUserEntity user) { - if(user.getStatus()!=0){ - throw new LinfengException("您的账号已被禁用"); + if(user.getStatus().equals(Constant.USER_BANNER)){ + throw new LinfengException(Constant.USER_BANNER_MSG); } PostEntity post=new PostEntity(); BeanUtils.copyProperties(request,post); diff --git a/src/main/java/io/linfeng/modules/app/controller/AppSystemConfigController.java b/src/main/java/io/linfeng/modules/app/controller/AppSystemConfigController.java index d4e99c8..db6eb3a 100644 --- a/src/main/java/io/linfeng/modules/app/controller/AppSystemConfigController.java +++ b/src/main/java/io/linfeng/modules/app/controller/AppSystemConfigController.java @@ -35,7 +35,7 @@ public class AppSystemConfigController { @ApiOperation("logo配置") - @GetMapping("/miniConfig") + @GetMapping("/config") public R miniConfig(){ SystemEntity system = systemService.miniConfig(); return R.ok().put("logo",system.getIntro()); diff --git a/src/main/resources/static/linfeng-community-uniapp-ky/pages/login/login.vue b/src/main/resources/static/linfeng-community-uniapp-ky/pages/login/login.vue index 56aed17..e94efab 100644 --- a/src/main/resources/static/linfeng-community-uniapp-ky/pages/login/login.vue +++ b/src/main/resources/static/linfeng-community-uniapp-ky/pages/login/login.vue @@ -47,7 +47,7 @@ }) }, getSysInfo() { - this.$H.get("system/miniConfig").then(res => { + this.$H.get("system/config").then(res => { if (res.code == 0) { this.logo = res.logo; } diff --git a/src/main/resources/static/linfeng-community-uniapp-ky/pages/login/weixin.vue b/src/main/resources/static/linfeng-community-uniapp-ky/pages/login/weixin.vue index 106d8f3..3cd2085 100644 --- a/src/main/resources/static/linfeng-community-uniapp-ky/pages/login/weixin.vue +++ b/src/main/resources/static/linfeng-community-uniapp-ky/pages/login/weixin.vue @@ -29,7 +29,7 @@ }); }, getSysInfo() { - this.$H.get("system/miniConfig").then(res => { + this.$H.get("system/config").then(res => { if (res.code == 0) { this.logo = res.logo; } diff --git a/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/user.vue b/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/user.vue index 6013e10..d9603b6 100644 --- a/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/user.vue +++ b/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/user.vue @@ -147,7 +147,7 @@ }); }, getSysInfo() { - this.$H.get('system/miniConfig').then(res => { + this.$H.get('system/config').then(res => { this.shareCover = res.logo; }); },