apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.22k stars 8.76k forks source link

配置context-path参数后,web页面无法访问接口 #5346

Closed guanpeijia closed 1 year ago

guanpeijia commented 1 year ago

Ⅰ. Issue Description

seata配置文件设置context-path参数后,web页面浏览路径增加context-path设置的参数,页面可以正常显示,但是页面查询接口404

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. 修改seata/conf/application.yml文件,增加context-path配置 `server: port: 7091 servlet: context-path: /seata

spring: application: name: seata-server`

  1. 访问web页面
funky-eyes commented 1 year ago

通过控制台查看请求的接口截图发出来看看,估计是因为加了context-path后接口的地址url不对了

guanpeijia commented 1 year ago

通过控制台查看请求的接口截图发出来看看,估计是因为加了context-path后接口的地址url不对了

前端请求的接口,没有获取contextPath,截图如下 image image

liuqiufeng commented 1 year ago

可以自行修改https://github.com/seata/seata/blob/2.x/console/src/main/resources/static/console-fe/src/utils/request.ts 中的baseURL: '/api/v1'baseURL: '/seata/api/v1'再重新对前端打包(console-fe目录下)

guanpeijia commented 1 year ago

可以自行修改https://github.com/seata/seata/blob/2.x/console/src/main/resources/static/console-fe/src/utils/request.ts 中的baseURL: '/api/v1'baseURL: '/seata/api/v1'再重新对前端打包(console-fe目录下)

在未来的版本中会自动识别contextPath吗?

slievrly commented 1 year ago

need to add the issue to the FAQ on the official website.