First of all, we need to see what is typed in the tomcat log. Because it is 500 on the server, it means that the server is abnormal. You need to look at the log.
The log error is ERROR com.mz.o2o.util.ImageUtil - java.io.FileNotFoundException: /Users/baidu/work/image/upload/images/item/shop/15/2022090522084613901.jpg (Permission denied)
I checked the directory of the address of the picture I uploaded and it was correct, but I couldn’t find the picture in it
So the final solution is to directly chmod 777 -R directory address, the reason is that Linux has permission control