1、开放api权限,admin模块权限设置后续会更新
2、修复优惠券领取时间不限制导致不显示的bug 3、更新了一些config配置数据
This commit is contained in:
@@ -28,11 +28,10 @@ public class AdminAuthInterceptor implements HandlerInterceptor {
|
||||
|
||||
Boolean result = systemRoleService.checkAuth(uri);
|
||||
|
||||
//TODO 此处暂时放开
|
||||
// if(!result){
|
||||
// response.getWriter().write(JSONObject.toJSONString(CommonResult.forbidden()));
|
||||
// return false;
|
||||
// }
|
||||
if(!result){
|
||||
response.getWriter().write(JSONObject.toJSONString(CommonResult.forbidden()));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class RestTemplateUtil {
|
||||
|
||||
public String postFormData(String url, MultiValueMap<String, String> map) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||
// headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||
HttpEntity<MultiValueMap<String, String>> requests = new HttpEntity<MultiValueMap<String, String>>(map, headers);
|
||||
String body = restTemplate.postForEntity(url, requests, String.class).getBody();
|
||||
return body;
|
||||
|
||||
@@ -38,4 +38,6 @@ public interface CategoryService extends IService<Category> {
|
||||
List<Category> getChildVoListByPid(Integer pid);
|
||||
|
||||
int checkName(String name, Integer type);
|
||||
|
||||
boolean checkUrl(String uri);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, Category> impl
|
||||
@Override
|
||||
public Boolean checkAuth(List<Integer> pathIdList, String uri) {
|
||||
LambdaQueryWrapper<Category> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(Category::getId, pathIdList).eq(Category::getStatus, 1).eq(Category::getUrl, uri);
|
||||
lambdaQueryWrapper.in(Category::getId, pathIdList).eq(Category::getUrl, uri);
|
||||
List<Category> categoryList = dao.selectList(lambdaQueryWrapper);
|
||||
if(categoryList.size() < 1){
|
||||
return false;
|
||||
@@ -343,7 +343,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, Category> impl
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测分类码是否存在
|
||||
* 检测分类名称是否存在
|
||||
* @param name String 分类名
|
||||
* @param type int 类型
|
||||
* @author Mr.Zhang
|
||||
@@ -357,5 +357,19 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, Category> impl
|
||||
.eq(Category::getType, type);
|
||||
return dao.selectCount(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测url是否存在
|
||||
* @param uri String url
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-04-16
|
||||
* @return int
|
||||
*/
|
||||
@Override
|
||||
public boolean checkUrl(String uri) {
|
||||
LambdaQueryWrapper<Category> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(Category::getUrl, uri);
|
||||
return dao.selectCount(lambdaQueryWrapper) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -286,6 +286,11 @@ public class StoreCouponServiceImpl extends ServiceImpl<StoreCouponDao, StoreCou
|
||||
if(null != couponUserMap && couponUserMap.containsKey(storeCoupon.getId())){
|
||||
response.setIsUse(true);
|
||||
}
|
||||
|
||||
if(response.getReceiveEndTime() == null){
|
||||
response.setReceiveStartTime(null);
|
||||
}
|
||||
|
||||
storeCouponFrontResponseArrayList.add(response);
|
||||
}
|
||||
|
||||
@@ -320,9 +325,8 @@ public class StoreCouponServiceImpl extends ServiceImpl<StoreCouponDao, StoreCou
|
||||
.eq(StoreCoupon::getStatus, 1)
|
||||
//剩余数量大于0 或者不设置上限
|
||||
.and(i -> i.gt(StoreCoupon::getLastTotal, 0).or().eq(StoreCoupon::getIsLimited, false))
|
||||
//领取时间范围
|
||||
.lt(StoreCoupon::getReceiveStartTime, date)
|
||||
.gt(StoreCoupon::getReceiveEndTime, date);
|
||||
//领取时间范围, 结束时间为null则是不限时
|
||||
.and(i -> i.isNull(StoreCoupon::getReceiveEndTime).or( p -> p.lt(StoreCoupon::getReceiveStartTime, date).gt(StoreCoupon::getReceiveEndTime, date)));
|
||||
if(productId > 0){
|
||||
//有商品id 通用券可以领取,商品券可以领取,分类券可以领取
|
||||
getPrimaryKeySql(lambdaQueryWrapper, productId.toString());
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -84,6 +84,11 @@ public class SystemRoleServiceImpl extends ServiceImpl<SystemRoleDao, SystemRole
|
||||
*/
|
||||
@Override
|
||||
public Boolean checkAuth(String uri) {
|
||||
//查询当前路由是否配置了权限,如果没有配置则直接通过
|
||||
if(!categoryService.checkUrl(uri)){
|
||||
return true;
|
||||
}
|
||||
|
||||
List<Integer> categoryIdList = getRoleListInRoleId();
|
||||
if(categoryIdList.size() < 1){
|
||||
return false;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# Host: 127.0.0.1 (MySQL 5.7.23)
|
||||
# Database: crmeb_java
|
||||
# Generation Time: 2020-08-28 05:02:57 +0000
|
||||
# Generation Time: 2020-08-31 07:52:55 +0000
|
||||
# ************************************************************
|
||||
|
||||
|
||||
@@ -5264,7 +5264,6 @@ LOCK TABLES `eb_system_config` WRITE;
|
||||
|
||||
INSERT INTO `eb_system_config` (`id`, `name`, `title`, `form_id`, `value`, `status`, `create_time`, `update_time`)
|
||||
VALUES
|
||||
(173,'seo_title','',0,'',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(177,'close_system','',0,'0',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(178,'wechat_appid','wechat_appid',65,'wx009a1974eb2a76b811',0,'2020-05-14 15:20:25','2020-08-11 20:23:31'),
|
||||
(179,'wechat_appsecret','wechat_appsecret',65,'adb3deca7e583eb94842f12766a32ed1111',0,'2020-05-14 15:20:25','2020-08-12 12:38:53'),
|
||||
@@ -5284,7 +5283,6 @@ VALUES
|
||||
(206,'sx_sign_min_int','',0,'1',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(207,'sx_sign_max_int','',0,'5',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(208,'about_us','',0,'',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(209,'replenishment_num','',0,'20',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(212,'api','',0,'\\/api\\/wechat\\/serve',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(218,'store_brokerage_rate_2','',0,'60',0,'2020-05-14 15:20:25','2020-07-14 16:44:54'),
|
||||
(219,'store_brokerage_status','store_brokerage_status',0,'1',0,'2020-05-14 15:20:25','2020-08-05 17:42:38'),
|
||||
@@ -5293,24 +5291,17 @@ VALUES
|
||||
(228,'fast_number','',0,'10',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(229,'bast_number','',0,'10',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(230,'first_number','',0,'10',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(231,'routine_index_logo','',0,'http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190801\\/deb30359d22c0b80f3cece86cb462104.png',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(232,'upload_type','',0,'4',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(233,'uploadUrl','',0,'https://wuht-1300909283.cos.ap-chengdu.myqcloud.com',0,'2020-05-14 15:20:25','2020-06-03 17:20:22'),
|
||||
(234,'accessKey','',0,'AKIDylJg18LnKgogJWBCftWwAASZR12312312313QMdYsQ',0,'2020-05-14 15:20:25','2020-06-03 17:20:54'),
|
||||
(235,'secretKey','',0,'SebIWXNxtpTs3bv0ps123213jKgmbEeqKckC4i',0,'2020-05-14 15:20:25','2020-06-03 17:21:02'),
|
||||
(236,'storage_name','',0,'wuht-13009031231239283',0,'2020-05-14 15:20:25','2020-06-03 17:21:18'),
|
||||
(237,'order_cancel_time','',0,'0.1',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(238,'order_activity_time','',0,'2',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(239,'order_bargain_time','',0,'',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(240,'order_seckill_time','',0,'',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(241,'order_pink_time','',0,'',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(242,'storage_region','',0,'ap-chengdu',0,'2020-05-14 15:20:25','2020-06-03 17:37:19'),
|
||||
(243,'vip_open','',0,'1',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(244,'new_order_audio_link','',0,'\\/public\\/uploads\\/config\\/file\\/5cedd83eedba2.mp3',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(245,'system_delivery_time','',0,'1',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(249,'offline_pay_status','',0,'2',0,'2020-05-14 15:20:25','2020-08-12 22:12:56'),
|
||||
(250,'news_slides_limit','',0,'5',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(251,'recharge_switch','',0,'1',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(254,'cache_config','',0,'86400',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(256,'develop_id','',0,'',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
(257,'printing_api_key','',0,'',0,'2020-05-14 15:20:25','2020-05-14 16:37:47'),
|
||||
@@ -5420,7 +5411,7 @@ VALUES
|
||||
(1610,'order_cancel_time','order_cancel_time',77,'1',0,'2020-08-13 12:22:23','2020-08-13 12:22:23'),
|
||||
(1611,'order_activity_time','order_activity_time',77,'2',0,'2020-08-13 12:22:23','2020-08-13 12:22:23'),
|
||||
(1612,'vip_open','vip_open',77,'1111',0,'2020-08-13 12:22:23','2020-08-13 12:22:23'),
|
||||
(1613,'new_order_audio_link','new_order_audio_link',77,'1111',0,'2020-08-13 12:22:23','2020-08-13 12:22:23'),
|
||||
(1613,'new_order_audio_link','new_order_audio_link',77,'\\/public\\/uploads\\/config\\/file\\/5cedd83eedba2.mp3',0,'2020-08-13 12:22:23','2020-08-31 15:51:34'),
|
||||
(1623,'site_name','site_name',64,'CRMEB',0,'2020-08-13 14:46:06','2020-08-13 14:46:06'),
|
||||
(1624,'site_url','site_url',64,'https://java.crmeb.net',0,'2020-08-13 14:46:06','2020-08-13 14:46:06'),
|
||||
(1625,'api_url','api_url',64,'https://api.java.crmeb.net',0,'2020-08-13 14:46:06','2020-08-13 14:46:06'),
|
||||
|
||||
Reference in New Issue
Block a user