Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

打开前端就是这样,是怎么回事? #8

Closed
pwshanjiji opened this issue Nov 17, 2023 · 38 comments
Closed

打开前端就是这样,是怎么回事? #8

pwshanjiji opened this issue Nov 17, 2023 · 38 comments

Comments

@pwshanjiji
Copy link

屏幕截图 2023-11-17 174010

@abel-chai
Copy link
Owner

你前后端都运行了吗

@pwshanjiji
Copy link
Author

运行了

@abel-chai
Copy link
Owner

你前端刷新界面,后端的控制台有什么报错信息吗

@pwshanjiji
Copy link
Author

屏幕截图 2023-11-17 214441
后端没反应

@abel-chai
Copy link
Owner

这个文件里面src\utils\request.js开头的baseURL改为baseURL = 'http://localhost:9999',试试看

@abel-chai
Copy link
Owner

这个环境变量没有改,目前你应该是用本地的服务器

@pwshanjiji
Copy link
Author

image
还是这样

@abel-chai
Copy link
Owner

上面那个baseURL改成localhost:9999
默认走的是这个process.env.NODE.ENV == "development"

@abel-chai
Copy link
Owner

应该是写前端的没改这个

@abel-chai
Copy link
Owner

最上面那个baseURL的赋值没啥作用,在if哪里又重新赋值了,可能我刚才描述的不是太全面

@abel-chai
Copy link
Owner

屏幕截图 2023-11-17 220856 这样

@pwshanjiji
Copy link
Author

那个问题解决了但是这些静态资源加载不出来
image

@pwshanjiji
Copy link
Author

后端也没有报错

@abel-chai
Copy link
Owner

你后端的项目目录看一下呗

@pwshanjiji
Copy link
Author

image

@pwshanjiji
Copy link
Author

image

@abel-chai
Copy link
Owner

那个img文件夹位置有问题,等一会回宿舍给你看一下

@pwshanjiji
Copy link
Author

嗯嗯,非常感谢

@abel-chai
Copy link
Owner

屏幕截图 2023-11-17 224214

@abel-chai
Copy link
Owner

后端项目目录,把下载的那个图片和音乐放在这里

@pwshanjiji
Copy link
Author

在哪下载,我没找到

@abel-chai
Copy link
Owner

额,链接失效了,看看传到网盘,但是好像速度有点慢。。

@pwshanjiji
Copy link
Author

没事啥时候都行

@abel-chai
Copy link
Owner

你现在下载呗,在那个music-player-back的readme文件里面有那个链接

@pwshanjiji
Copy link
Author

好的

@pwshanjiji
Copy link
Author

image
image
添加完之后是这样的

@abel-chai
Copy link
Owner

请求之后后端报的啥信息

@pwshanjiji
Copy link
Author

image
后端没啥

@pwshanjiji
Copy link
Author

image
但是登录后会报错

@abel-chai
Copy link
Owner

你会用postman嘛,发几个请求给后端,看后端可正常响应

@abel-chai
Copy link
Owner

还有你的redis开了吧

@abel-chai
Copy link
Owner

数据库配置文件改你自己的用户名密码啥的

@pwshanjiji
Copy link
Author

数据库和redis没啥问题

@pwshanjiji
Copy link
Author

image
image
这样吗

@pwshanjiji
Copy link
Author

image

@abel-chai
Copy link
Owner

你后端服务器的端口不是9999嘛

@abel-chai
Copy link
Owner

application.ymal文件,你截一下你的
Uploading 1.png…

@abel-chai
Copy link
Owner

你后端开着,然后浏览器请求一下这个地址http://localhost:9999/img/bannerImg/1.jpg,看一下出不出来页面,以及后端有没有报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants