Saber部署到nginx, 登录页no handler found for get /api/blade-auth/oauth/captcha 报错,不能登录

Blade 未结 1 792
chenjunzhen
chenjunzhen 剑童 2021-11-17 20:15

一、该问题的重现步骤是什么?


1. saber 打包后的 dist目录 ,上传到 nginx下到 html目录  ,前端对应的域名是  https://illegal-test-web.yunchuangdao.com/

2. 后端bladex-boot,已经发布启动成功, 对应域名是 https://illegal-test.yunchuangdao.com/

3. 打开首页,no handler found for get /api/blade-auth/oauth/captcha 报错,验证码没有出现


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?


  -- Springblade v3.0.3版本

Linux  CentOS 8.0


四、请提供详细的错误堆栈信息,这很重要。


chunk-vendors.ad7a7464.js:8 GET https://illegal-test-web.yunchuangdao.com/blade-system/tenant/info?domain=https:%2F%2Fillegal-test-web.yunchuangdao.com 404 (Not Found)


chunk-vendors.ad7a7464.js:8 GET https://illegal-test-web.yunchuangdao.com/blade-auth/captcha 404 (Not Found)


五、若有更多详细信息,请在下面提供。

1条回答
  • 2021-11-17 20:46

    解决方案: 

    1. 先到 Saber 项目中 ,在vue.config.js中,将devServer配置项给注释掉,再重新 yarn run build打包,重新发包到服务器

    2. 在服务器Saber对应的nginx 的 .conf文件中,加上配置:


      location ^~/api {

                              rewrite ^/api/(.*)$ /$1 break;

                  proxy_pass http://illegal-test.yunchuangdao.com; # 这里网址对应是你的后台网关地址

       }

    0 讨论(0)
提交回复