springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommonApi.java
@@ -86,7 +86,8 @@ String originName = file.getOriginalFilename(); AtomicBoolean isVideo = new AtomicBoolean(false); videoExtensionAllow.forEach(ext ->{ if(ext.equalsIgnoreCase(originName)){ String originNameLowerCase = originName.toLowerCase(); if(originNameLowerCase.endsWith("." +ext)){ isVideo.set(true); } }); springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityConvenientApi.java
@@ -208,10 +208,12 @@ InputStream inputStream = null; try { inputStream = file.getInputStream(); EasyExcel.read(inputStream, ComCvtServeExcelVO.class, new ComCvtServeExcelListen(communityService,null)).sheet().doRead(); EasyExcel.read(inputStream, ComCvtServeExcelVO.class, new ComCvtServeExcelListen(communityService,null)) .sheet().doRead(); } catch (IOException e) { e.printStackTrace(); log.error("导入模板失败【{}】", e.getMessage()); return R.fail(); } return R.ok(); } springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/ShopApi.java
@@ -130,7 +130,7 @@ @ApiOperation(value = "编辑商家、启用、禁用") @PostMapping("/store/edit/{id}") @ApiImplicitParam(name = "id", value = "商家id") public R editStore(@Validated(AddGroup.class) @RequestBody ShopStoreVO storeVO, @PathVariable("id") Long id) { public R editStore(@Validated @RequestBody ShopStoreVO storeVO, @PathVariable("id") Long id) { //判断参数 if(storeVO == null || id == null){ return R.fail("参数错误"); springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/constants/HttpStatus.java
@@ -73,6 +73,11 @@ public static final int CONFLICT = 409; /** * 请求主体的大小超过了服务器 */ public static final int REQUEST_TOO_LARGE = 413; /** * 不支持的数据,媒体类型 */ public static final int UNSUPPORTED_TYPE = 415; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java
@@ -1,6 +1,7 @@ package com.panzhihua.common.utlis; import com.alibaba.fastjson.JSONObject; import com.panzhihua.common.exceptions.ServiceException; import lombok.extern.slf4j.Slf4j; import java.util.Base64; @@ -37,12 +38,19 @@ log.info("请求公安实名认证接口,请求地址:" + URL); log.info("请求公安实名认证接口,请求参数:" + param); log.info("请求公安实名认证接口,请求头参数:" + headervalue + encodeToString); String postByJson = HttpClientUtil.sendPostByJson(URL, param, 0, headerkey, headervalue + encodeToString); String postByJson = HttpClientUtil.sendPostByJson(URL, param, 2, headerkey, headervalue + encodeToString); log.info("请求公安实名认证接口,返回参数:" + postByJson); if(postByJson!=null && StringUtils.isNotEmpty(postByJson)) { JSONObject obj = JSONObject.parseObject(postByJson); if(obj!=null) { int code = JSONObject.parseObject(postByJson).getIntValue("code"); if (0==code) { result =true; } } }else{ throw new ServiceException("公安实名认证接口超时,请重试"); } return result; } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityConvenientApi.java
@@ -191,6 +191,7 @@ } catch (IOException e) { e.printStackTrace(); log.error("导入模板失败【{}】", e.getMessage()); return R.fail(); } return R.ok(); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngStructAreaDAO.java
@@ -43,7 +43,7 @@ "AND community_id=#{comMngStructAreaVO.communityId} \n" + " </if> " + "<if test='comMngStructAreaVO.areaName != null and comMngStructAreaVO.areaName.trim() != ""'>" + "AND area_name = concat( '%',#{comMngStructAreaVO.areaName}, '%' )" + "AND area_name like concat( '%',#{comMngStructAreaVO.areaName}, '%' )" + " </if> " + "</script>") IPage<ComMngStructAreaVO> pageArea(Page page, @Param("comMngStructAreaVO") ComMngStructAreaVO comMngStructAreaVO); springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -609,10 +609,14 @@ String idCard = loginUserInfoVO.getIdCard(); String name = loginUserInfoVO.getName(); log.info("用户实名认证发送请求,姓名:" + name + "身份证号码:" + idCard); try { boolean b = RealNameUtil.authentication(idCard, name); if (!b) { return R.fail("身份认证失败:请填写真实信息"); } }catch (ServiceException serviceException){ return R.fail(serviceException.getMessage()); } SysUserDO sysUserDO = new SysUserDO(); sysUserDO.setName(name); sysUserDO.setIdCard(idCard); springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/handles/FileUploadExceptionAdvice.java
New file @@ -0,0 +1,40 @@ package com.panzhihua.zuul.handles; import com.panzhihua.common.constants.HttpStatus; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.utlis.ResultUtil; import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.multipart.MaxUploadSizeExceededException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @ControllerAdvice public class FileUploadExceptionAdvice { @ExceptionHandler(MaxUploadSizeExceededException.class) public void handleMaxSizeException( MaxUploadSizeExceededException exc, HttpServletRequest request, HttpServletResponse response) { //请求超过大小限制 response.setContentType("application/json;charset=utf-8"); ResultUtil.responseJson(response, R.fail(HttpStatus.REQUEST_TOO_LARGE, "请求主体的大小超过限制")); return; } @ExceptionHandler(FileSizeLimitExceededException.class) public void handleFileSizeLimitException( FileSizeLimitExceededException exc, HttpServletRequest request, HttpServletResponse response) { //请求超过大小限制 response.setContentType("application/json;charset=utf-8"); ResultUtil.responseJson(response, R.fail(HttpStatus.REQUEST_TOO_LARGE, "文件大小超过限制")); return; } } springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/resources/bootstrap.yml
@@ -20,8 +20,8 @@ active: ${ENV:dev} servlet: multipart: max-file-size: 10MB max-request-size: 10MB max-file-size: 20MB max-request-size: 22MB eureka: client: