|
@@ -194,30 +194,30 @@ public class AuthInfoServiceImpl implements AuthInfoService {
|
|
|
BasicSchool basicSchool = basicSchoolService.getOne(basicSchoolQueryWrapper);
|
|
|
if (Objects.isNull(basicSchool)) {//不存在则创建学校
|
|
|
basicSchool = new BasicSchool(o.getId(), o.getCode(), o.getName(), o.getAccessKey(), o.getAccessSecret());
|
|
|
- if (Objects.nonNull(o.getLogo()) && (!o.getLogo().startsWith("https:") || !o.getLogo().startsWith("http"))) {
|
|
|
- File fileTemp = null;
|
|
|
- String dirName = null;
|
|
|
- try {
|
|
|
-// File fileNew = new File("/Users/king/Downloads/spring.jpg");
|
|
|
- fileTemp = File.createTempFile("temp", ".jpg");
|
|
|
- SystemConstant.base64ToImage(o.getLogo(), fileTemp.getPath());
|
|
|
-// FileUtils.copyInputStreamToFile(new FileInputStream(fileNew), fileTemp);
|
|
|
-
|
|
|
- dirName = stringJoiner.toString() + NanoIdUtils.randomNanoId() + "." + FilenameUtils.getExtension(fileTemp.getPath());
|
|
|
- fileStoreUtil.ossUpload(dirName, fileTemp, DigestUtils.md5Hex(new FileInputStream(fileTemp)), UploadFileEnum.FILE.getFssType());
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(SystemConstant.LOG_ERROR, e);
|
|
|
- } finally {
|
|
|
- if (Objects.nonNull(fileTemp)) {
|
|
|
- fileTemp.delete();
|
|
|
- }
|
|
|
- if (Objects.nonNull(dirName)) {
|
|
|
- basicSchool.setLogo(dictionaryConfig.fssPublicDomain().getServer() + File.separator + dirName);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
+// if (Objects.nonNull(o.getLogo()) && (!o.getLogo().startsWith("https:") || !o.getLogo().startsWith("http"))) {
|
|
|
+// File fileTemp = null;
|
|
|
+// String dirName = null;
|
|
|
+// try {
|
|
|
+//// File fileNew = new File("/Users/king/Downloads/spring.jpg");
|
|
|
+// fileTemp = File.createTempFile("temp", ".jpg");
|
|
|
+// SystemConstant.base64ToImage(o.getLogo(), fileTemp.getPath());
|
|
|
+//// FileUtils.copyInputStreamToFile(new FileInputStream(fileNew), fileTemp);
|
|
|
+//
|
|
|
+// dirName = stringJoiner.toString() + NanoIdUtils.randomNanoId() + "." + FilenameUtils.getExtension(fileTemp.getPath());
|
|
|
+// fileStoreUtil.ossUpload(dirName, fileTemp, DigestUtils.md5Hex(new FileInputStream(fileTemp)), UploadFileEnum.FILE.getFssType());
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error(SystemConstant.LOG_ERROR, e);
|
|
|
+// } finally {
|
|
|
+// if (Objects.nonNull(fileTemp)) {
|
|
|
+// fileTemp.delete();
|
|
|
+// }
|
|
|
+// if (Objects.nonNull(dirName)) {
|
|
|
+// basicSchool.setLogo(dictionaryConfig.fssPublicDomain().getServer() + File.separator + dirName);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } else {
|
|
|
basicSchool.setLogo(o.getLogoUrl());
|
|
|
- }
|
|
|
+// }
|
|
|
basicSchoolSet.add(basicSchool);
|
|
|
} else {
|
|
|
basicSchool.setAccessKey(o.getAccessKey());
|