简体   繁体   English

Java Spring Boot:项目用IDE Intellji打开时图片保存路径错误,不显示图片

[英]Java Spring Boot: project saves images in the wrong path and not display images when opening with IDE Intellji

I have a project, my project is multiple module project like in the picture below, I used SpringToolSuite(STS) to code this project, recently I switched to Intellji so I opened this project with the Intellji IDE我有一个项目,我的项目是如下图所示的多模块项目,我使用 SpringToolSuite(STS) 对这个项目进行编码,最近我切换到 Intellji 所以我用 Intellji IDE 打开了这个项目

多模块项目

When I open this project with STS, it shows the image in the browser normally, but when I open this project with Intellji IDE, it doesn't load the image in the browser.当我用STS打开这个项目时,它在浏览器中正常显示图像,但是当我用Intellji IDE打开这个项目时,它不会在浏览器中加载图像。

I have a code that saves images, when I use STS , the images are saved to a folder with the path: "ShopmeProject\\ShopmeWebParent\\ShopmeBackEnd\\user-photo"我有一个保存图像的代码,当我使用 STS 时,图像将保存到一个文件夹中,路径为: “ShopmeProject\\ShopmeWebParent\\ShopmeBackEnd\\user-photo”

But when I use Intellji IDE , my image is saved to the path: "ShopmeProject\\user-photo"但是当我使用 Intellji IDE 时,我的图像被保存到路径: “ShopmeProject\\user-photo”

So I need someone who can help me to configure my project to run properly on Intellji IDE所以我需要有人可以帮助我配置我的项目以在 Intellji IDE 上正常运行

I'm following this step and it works perfect我正在执行此步骤,并且效果很好

Step 1:第1步:

在此处输入图片说明

Step 2: set Working directory as $MODULE_WORKING_DIR$第 2 步:将工作目录设置为 $MODULE_WORKING_DIR$

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM