|
@@ -324,7 +324,7 @@ public class FileUploadUtils {
|
|
|
* @param image 图片数据
|
|
* @param image 图片数据
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public static String saveFaceImage(String imgStr) {
|
|
|
|
|
|
|
+ public static String saveFaceImage(String imgStr,String filePath) {
|
|
|
|
|
|
|
|
if (imgStr == null) // 图像数据为空
|
|
if (imgStr == null) // 图像数据为空
|
|
|
return null;
|
|
return null;
|
|
@@ -352,13 +352,12 @@ public class FileUploadUtils {
|
|
|
String uuid = uuid();
|
|
String uuid = uuid();
|
|
|
// 拼接文件路径
|
|
// 拼接文件路径
|
|
|
String fileName = uuid + "." + suffix;
|
|
String fileName = uuid + "." + suffix;
|
|
|
- // 图片的路径
|
|
|
|
|
- String imagePath = "facecompare" + "/" + fileName;
|
|
|
|
|
// 这里目前只会说图片的
|
|
// 这里目前只会说图片的
|
|
|
String contentType = "image/" + suffix;
|
|
String contentType = "image/" + suffix;
|
|
|
- uploadFile(imagePath, contentType, b);
|
|
|
|
|
|
|
+ uploadFile(filePath, contentType, b);
|
|
|
// FileUtils.writeByteArrayToFile(fullPath, b);
|
|
// FileUtils.writeByteArrayToFile(fullPath, b);
|
|
|
- return imagePath;
|
|
|
|
|
|
|
+ log.info("上传图片成功"+filePath);
|
|
|
|
|
+ return filePath;
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("上传图片失败:" + e.getLocalizedMessage());
|
|
log.error("上传图片失败:" + e.getLocalizedMessage());
|
|
|
return null;
|
|
return null;
|