From 8e1325c9e52995f0d8f67648f2d1df6ccf16fb0f Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Mon, 20 May 2024 14:19:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E5=BA=B7=E7=9A=84=E4=BA=BA=E8=84=B8?= =?UTF-8?q?=E8=AF=84=E5=88=86=E6=94=B9=E6=88=90url=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../worker/controller/UfaceRecognitionController.java | 8 +++++--- .../java/com/zhgd/xmgl/security/WebSecurityConfig.java | 1 + src/main/resources/application-gsx-t-dev.properties | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/controller/UfaceRecognitionController.java b/src/main/java/com/zhgd/xmgl/modules/worker/controller/UfaceRecognitionController.java index 6fa7e753c..d3f6ba9cc 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/controller/UfaceRecognitionController.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/controller/UfaceRecognitionController.java @@ -15,7 +15,6 @@ import com.zhgd.xmgl.modules.project.entity.Project; import com.zhgd.xmgl.modules.project.mapper.ProjectMapper; import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService; -import com.zhgd.xmgl.util.Base64Util; import com.zhgd.xmgl.util.MessageUtil; import com.zhgd.xmgl.util.PathUtil; import io.swagger.annotations.Api; @@ -61,7 +60,8 @@ public class UfaceRecognitionController { private HikvisionCall hikvisionCall; @Autowired private ProjectMapper projectMapper; - + @Value("${upload.image.url.prefix:}") + private String imageUrlPrefix; @ApiOperation(value = "检测人脸照片是否有人脸", notes = "列表查询人脸设备信息", httpMethod = "POST") @ApiImplicitParams({ @@ -121,7 +121,9 @@ public class UfaceRecognitionController { if (StrUtil.isBlank(fileUrl)) { throw new OpenAlertException("fileUrl不能为空"); } - param.put("facePicBinaryData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(basePath + "/" + fileUrl))); + //base64可能卡 + //param.put("facePicBinaryData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(basePath + "/" + fileUrl))); + param.put("facePicUrl", PathUtil.reviseSlash(imageUrlPrefix + "/" + fileUrl)); boolean b = hikvisionCall.faceScore(project, param); if (b) { data.put("checkType", "1"); diff --git a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java index 2664d9142..c99d69644 100644 --- a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java +++ b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java @@ -80,6 +80,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { http.authorizeRequests() //请求路径允许访问 + .antMatchers("/xmgl/xzEmergencyType/**").permitAll() .antMatchers("/xmgl/xzEmergencyRecord/**").permitAll() .antMatchers("/xmgl/xzDeductScoreRecord/**").permitAll() .antMatchers("/xmgl/workerInfo/selectWorkerInfoByIdCard").permitAll() diff --git a/src/main/resources/application-gsx-t-dev.properties b/src/main/resources/application-gsx-t-dev.properties index 9ed3849e5..8cb552929 100644 --- a/src/main/resources/application-gsx-t-dev.properties +++ b/src/main/resources/application-gsx-t-dev.properties @@ -96,3 +96,5 @@ xiwon.appSecret=b6162078-6f1c-4f2c-8cd5-0873f45199b2 magic-api.web=/xmgl/magic/web #配置文件存储位置。当以classpath开头时,为只读模式 magic-api.resource.location=C:/jxj/prod/backEnd/itbgpImage/data/magic-api +#上传的图片的url前缀 +upload.image.url.prefix=http://192.168.34.221:11111/image/