doramart / DoraCMS

DoraCMS是基于Nodejs+eggjs+mongodb编写的一套内容管理系统,结构简单,较目前一些开源的cms,doracms易于拓展,特别适合前端开发工程师做二次开发。
https://www.html-js.cn
MIT License
3.45k stars 1.02k forks source link

Docker 部署到本地后,打开后台页面登录,后台页面显示为空白 #251

Open Kennytian opened 2 years ago

Kennytian commented 2 years ago
Access to script at 'http://127.0.0.1:8080/static/navbar/js/app.js' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
system.min.js:4 GET http://127.0.0.1:8080/static/navbar/js/app.js net::ERR_FAILED
dashboard:1 Access to script at 'http://127.0.0.1:8080/static/dashboard/js/app.js' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
system.min.js:4 GET http://127.0.0.1:8080/static/dashboard/js/app.js net::ERR_FAILED
app-errors.js:9 Uncaught dashboard: Application 'dashboard' died in status LOADING_SOURCE_CODE: Error loading http://127.0.0.1:8080/static/dashboard/js/app.js
    at HTMLScriptElement.<anonymous> (http://localhost:8080/static/plugins/systemjs/4.1.0/system.min.js:4:4496
dashboard:1 The resource http://localhost:8080/static/plugins/element-ui/2.11.1/index.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

看起来是这两个跨域了

aaronnew2018 commented 2 years ago

怎么解决?

lautin89 commented 1 year ago

尝试使用127.0.0.1:8080/dr-admin,而不是localhost访问