詹子聪 пре 5 година
родитељ
комит
2944c1bf1d

+ 4 - 2
src/main/java/com/itant/laf/controller/api/LostFoundController.java

@@ -41,7 +41,8 @@ public class LostFoundController {
         responseResult.setResultCode(ResultCode.FAILED_COMMON);
         responseResult.setMessage("发布失败");
 
-        String postPhotoDir = request.getSession().getServletContext().getRealPath("/resources/image/post") + File.separator;
+        //String postPhotoDir = request.getSession().getServletContext().getRealPath("/resources/image/post") + File.separator;
+        String postPhotoDir = "/file/shiwushu/post/";
         File bgDirFile = new File(postPhotoDir);
         if (!bgDirFile.exists()) {
             bgDirFile.mkdirs();
@@ -58,7 +59,8 @@ public class LostFoundController {
                 out.flush();
                 out.close();
 
-                lostFound.setPhotoUrl("/resources/image/post/" + userId + fileName);
+                //lostFound.setPhotoUrl("/resources/image/post/" + userId + fileName);
+                lostFound.setPhotoUrl(userId + fileName);
             } catch (Exception e) {
                 responseResult.setMessage("发布失败");
                 e.printStackTrace();

+ 4 - 2
src/main/java/com/itant/laf/controller/api/UserController.java

@@ -310,7 +310,8 @@ public class UserController {
         responseResult.setResultCode(ResultCode.FAILED_COMMON);
         responseResult.setMessage("更新资料失败");
 
-        String headDir = request.getSession().getServletContext().getRealPath("/resources/image/head") + File.separator;
+        //String headDir = request.getSession().getServletContext().getRealPath("/resources/image/head") + File.separator;
+        String headDir = "/file/shiwushu/head/";
         File bgDirFile = new File(headDir);
         if (!bgDirFile.exists()) {
             bgDirFile.mkdirs();
@@ -327,7 +328,8 @@ public class UserController {
                 out.flush();
                 out.close();
 
-                dbUser.setHeadIcon("/resources/image/head/" + userId + suffix);
+                //dbUser.setHeadIcon("/resources/image/head/" + userId + suffix);
+                dbUser.setHeadIcon(userId + suffix);
             } catch (Exception e) {
                 responseResult.setMessage("更新资料失败");
                 e.printStackTrace();