From bb7ea5881e8db2a8ebe2ff969dd2a45d7f72781a Mon Sep 17 00:00:00 2001 From: Chopper Date: Thu, 5 Aug 2021 18:05:27 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/lili/modules/member/entity/vo/StoreCollectionVO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/member/entity/vo/StoreCollectionVO.java b/framework/src/main/java/cn/lili/modules/member/entity/vo/StoreCollectionVO.java index 903fcd12..050cb6db 100644 --- a/framework/src/main/java/cn/lili/modules/member/entity/vo/StoreCollectionVO.java +++ b/framework/src/main/java/cn/lili/modules/member/entity/vo/StoreCollectionVO.java @@ -13,13 +13,13 @@ import lombok.Data; public class StoreCollectionVO { @ApiModelProperty(value = "店铺id") - private String storeId; + private String id; @ApiModelProperty(value = "店铺名称") private String storeName; @ApiModelProperty(value = "店铺Logo") - private String logo; + private String storeLogo; @ApiModelProperty(value = "是否自营") private Boolean selfOperated; From 9b7f5f30fac3f3aeb94b7a955d002cd49c60138f Mon Sep 17 00:00:00 2001 From: Chopper Date: Thu, 5 Aug 2021 18:13:43 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=BA=97=E9=93=BA?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=95=86=E5=93=81id=E9=9B=86?= =?UTF-8?q?=E5=90=88=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=88=99=E4=B8=8D=E5=81=9A?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E8=A7=A3=E5=86=B3=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java index 50750b80..9d57ebcb 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java @@ -278,6 +278,12 @@ public class GoodsServiceImpl extends ServiceImpl implements @Override public Boolean updateGoodsMarketAble(List goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) { + + //如果商品为空,直接返回 + if (goodsIds == null || goodsIds.isEmpty()) { + return true; + } + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(); updateWrapper.set(Goods::getMarketEnable, goodsStatusEnum.name()); updateWrapper.set(Goods::getUnderMessage, underReason); From ba81cc5ece98146ce1c086e573de603d0670761a Mon Sep 17 00:00:00 2001 From: Chopper Date: Thu, 5 Aug 2021 20:03:30 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=A2=AB=E5=86=99?= =?UTF-8?q?=E6=AD=BB=E9=97=AE=E9=A2=98=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/lili/modules/message/util/WechatAccessTokenUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java b/framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java index 2f8ba06b..fc7411c8 100644 --- a/framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java +++ b/framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java @@ -68,7 +68,7 @@ public class WechatAccessTokenUtil { } //获取token String content = HttpUtil.get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential" + - "&appid=wx6cfbe6e0ace12ce8&secret=6dfbe0c72380dce5d49d65b3c91059b1"); + "&appid=" + item.getAppId() + "&secret=" + item.getAppSecret()); JSONObject object = new JSONObject(content); log.info("token获取【" + clientTypeEnum.name() + "】返回" + object.toString()); From e01586b394fa14b7dec3c4c61ad62689a0c2fc23 Mon Sep 17 00:00:00 2001 From: Chopper Date: Fri, 6 Aug 2021 11:46:23 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9D=83=E9=99=90=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/modules/system/token/ManagerTokenGenerate.java | 2 +- .../main/java/cn/lili/security/ManagerAuthenticationFilter.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/system/token/ManagerTokenGenerate.java b/framework/src/main/java/cn/lili/modules/system/token/ManagerTokenGenerate.java index 20827a25..bcdbdb60 100644 --- a/framework/src/main/java/cn/lili/modules/system/token/ManagerTokenGenerate.java +++ b/framework/src/main/java/cn/lili/modules/system/token/ManagerTokenGenerate.java @@ -77,7 +77,7 @@ public class ManagerTokenGenerate extends AbstractTokenGenerate { //循环权限菜单 userMenuVOList.forEach(menu -> { //循环菜单,赋予用户权限 - if (menu.getPermission() != null) { + if (!menu.getPermission().isEmpty()) { //获取路径集合 String[] permissionUrl = menu.getPermission().split(","); //for循环路径集合 diff --git a/manager-api/src/main/java/cn/lili/security/ManagerAuthenticationFilter.java b/manager-api/src/main/java/cn/lili/security/ManagerAuthenticationFilter.java index ad040122..46c12778 100755 --- a/manager-api/src/main/java/cn/lili/security/ManagerAuthenticationFilter.java +++ b/manager-api/src/main/java/cn/lili/security/ManagerAuthenticationFilter.java @@ -84,7 +84,9 @@ public class ManagerAuthenticationFilter extends BasicAuthenticationFilter { //如果不是超级管理员, 则鉴权 if (!authUser.getIsSuper()) { + //获取缓存中的权限 Map> permission = (Map>) cache.get(CachePrefix.PERMISSION_LIST.getPrefix(UserEnums.MANAGER) + authUser.getId()); + //获取数据(GET 请求)权限 if (request.getMethod().equals(RequestMethod.GET.name())) { //如果用户的超级权限和查阅权限都不包含当前请求的api From c3b6c88471a67342ee0531d0f4de3b1c60bf5c03 Mon Sep 17 00:00:00 2001 From: Chopper Date: Fri, 6 Aug 2021 12:02:30 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=9D=83=E9=99=90=E5=88=A4=E5=AE=9A?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/AdminUserServiceImpl.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/AdminUserServiceImpl.java b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/AdminUserServiceImpl.java index b4b56844..c6361bb2 100644 --- a/framework/src/main/java/cn/lili/modules/permission/serviceimpl/AdminUserServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/permission/serviceimpl/AdminUserServiceImpl.java @@ -157,15 +157,20 @@ public class AdminUserServiceImpl extends ServiceImpl roles) { - if (roles.size() > rolesMaxSize) { - throw new ServiceException(ResultCode.PERMISSION_BEYOND_TEN); - } + if (roles != null && roles.size() > 0) { + + if (roles.size() > rolesMaxSize) { + throw new ServiceException(ResultCode.PERMISSION_BEYOND_TEN); + } adminUser.setRoleIds(StringUtils.join(",", roles)); + + } else { + adminUser.setRoleIds(""); } - this.updateById(adminUser); updateRole(adminUser.getId(), roles); + this.updateById(adminUser); return true; } From 6c22bf24a6796a2e876585f6b13510b136732b44 Mon Sep 17 00:00:00 2001 From: Chopper Date: Fri, 6 Aug 2021 17:51:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=A5=BC=E5=B1=82=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF=E6=BC=94=E7=A4=BA?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E5=88=99=E4=B8=8D=E8=83=BD=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E6=A5=BC=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../page/serviceimpl/PageDataServiceImpl.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/page/serviceimpl/PageDataServiceImpl.java b/framework/src/main/java/cn/lili/modules/page/serviceimpl/PageDataServiceImpl.java index 2595e44e..a06d030f 100644 --- a/framework/src/main/java/cn/lili/modules/page/serviceimpl/PageDataServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/page/serviceimpl/PageDataServiceImpl.java @@ -1,11 +1,11 @@ package cn.lili.modules.page.serviceimpl; +import cn.lili.common.enums.ClientTypeEnum; import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.SwitchEnum; import cn.lili.common.exception.ServiceException; -import cn.lili.mybatis.util.PageUtil; +import cn.lili.common.properties.SystemSettingProperties; import cn.lili.common.vo.PageVO; -import cn.lili.common.enums.ClientTypeEnum; import cn.lili.modules.page.entity.dos.PageData; import cn.lili.modules.page.entity.dto.PageDataDTO; import cn.lili.modules.page.entity.enums.PageEnum; @@ -13,11 +13,13 @@ import cn.lili.modules.page.entity.vos.PageDataListVO; import cn.lili.modules.page.entity.vos.PageDataVO; import cn.lili.modules.page.mapper.PageDataMapper; import cn.lili.modules.page.service.PageDataService; +import cn.lili.mybatis.util.PageUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** @@ -29,6 +31,10 @@ import org.springframework.stereotype.Service; @Service public class PageDataServiceImpl extends ServiceImpl implements PageDataService { + + @Autowired + private SystemSettingProperties systemSettingProperties; + @Override public void addStorePageData(String storeId) { //设置店铺的PC页面 @@ -51,12 +57,15 @@ public class PageDataServiceImpl extends ServiceImpl i @Override public PageData addPageData(PageData pageData) { //如果页面为发布,则关闭其他页面,开启此页面 - if (pageData.getPageShow().equals(SwitchEnum.OPEN.name())) { + //演示站点不可以开启楼层 + if (!systemSettingProperties.getIsDemoSite() && pageData.getPageShow().equals(SwitchEnum.OPEN.name())) { LambdaUpdateWrapper lambdaUpdateWrapper = Wrappers.lambdaUpdate(); lambdaUpdateWrapper.eq(PageData::getPageType, pageData.getPageType()); lambdaUpdateWrapper.eq(PageData::getPageClientType, pageData.getPageClientType()); lambdaUpdateWrapper.set(PageData::getPageShow, SwitchEnum.CLOSE.name()); this.update(lambdaUpdateWrapper); + } else { + pageData.setPageShow(SwitchEnum.CLOSE.name()); } this.save(pageData); return pageData;