不及跬步,无以至千里,不积小流,无以成江海。——荀子

https://github.com/apache/shenyu/pull/5510

[Fix] Resolve dashboard routing mismatch post context-path update by VampireAchao · Pull Request #428 · apache/shenyu-dashboard · GitHub

主要是将IndexController中新增了一个路由/

1
@RequestMapping(value = {"/index", "/"})

然后在shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/ApplicationStartListener.java

注入了

1
2
@Value("${server.servlet.context-path:}")
private String contextPath;

并且拼接在后面

1
ShenyuDomain.getInstance().setHttpPath("http://" + String.join(":", host, String.valueOf(port)) + contextPath);

再把dashboard.webpackrc.jspublicPath改为相对路径即可

1
publicPath: ""