فهرست منبع

Merge remote-tracking branch 'origin/dev' into dev

Aron 6 سال پیش
والد
کامیت
a3c85117ca
2فایلهای تغییر یافته به همراه12 افزوده شده و 21 حذف شده
  1. 11 0
      src/main/java/com/ifast/oss/service/impl/FileServiceImpl.java
  2. 1 21
      src/main/resources/application.properties

+ 11 - 0
src/main/java/com/ifast/oss/service/impl/FileServiceImpl.java

@@ -28,6 +28,17 @@ public class FileServiceImpl extends CoreServiceImpl<FileDao, FileDO> implements
 
     @Override
     public String upload(byte[] uploadBytes, String fileName) {
+
+
+        //处理浏览器文件名获取兼容问题
+        if(fileName == null) {
+            fileName =  "";
+        } else {
+            int unixSep = fileName.lastIndexOf("/");
+            int winSep = fileName.lastIndexOf("\\");
+            int pos = winSep > unixSep?winSep:unixSep;
+            fileName= pos != -1?fileName.substring(pos + 1):fileName;
+        }
 //        fileName = fileName.substring(0, fileName.indexOf(".")) + "-" + System.currentTimeMillis() + fileName.substring(fileName.indexOf("."));
 //        fileName = ifastConfig.getProjectName() + "/" + DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_8)
 //                + "/" + fileName;

+ 1 - 21
src/main/resources/application.properties

@@ -1,7 +1,7 @@
 spring.mail.host=smtp.163.com
 spring.mail.username=18291548738@163.com
 #\u6388\u6743\u7801g\uFF0C\u5728QQ\u90AE\u7BB1\u5BA2\u6237\u7AEF\u751F\u6210 \u4FEE\u6539\u6210\u81EA\u5DF1\u7684  \u8BBE\u7F6E-\u8D26\u6237-\u5F00\u542F\u670D\u52A1-\u83B7\u53D6\u6388\u6743\u7801
-spring.mail.password=zyl163com
+spring.mail.password=xxxxxxx
 spring.mail.protocol=smtp
 spring.mail.port=25
 spring.mail.default-encoding=UTF-8
@@ -10,23 +10,3 @@ spring.mail.properties.mail.smtp.auth=true
 spring.mail.properties.mail.smtp.timeout=25000
 spring.mail.properties.mail.smtp.starttls.enable=true
 spring.mail.properties.mail.smtp.starttls.required=true
-
-#freemarker
-spring.freemarker.template-loader-path=classpath:/static/template/
-spring.freemarker.enabled=true
-spring.freemarker.cache=false
-spring.freemarker.charset=UTF-8
-spring.freemarker.content-type=text/html
-spring.freemarker.allow-request-override=false
-spring.freemarker.check-template-location=true
-spring.freemarker.expose-request-attributes=false
-spring.freemarker.expose-session-attributes=false
-spring.freemarker.expose-spring-macro-helpers=false
-
-#thymeleaf
-spring.thymeleaf.prefix=classpath:/static/template/
-spring.thymeleaf.suffix=.html
-spring.thymeleaf.mode=HTML5
-spring.thymeleaf.encoding=UTF-8
-spring.thymeleaf.content-type=text/html  
-spring.thymeleaf.cache=false