✨ 支持 server.servlet.context-path 自适应配置 - #12
Open
yangjinhe wants to merge 1 commit into
Open
Conversation
yangjinhe
commented
Aug 14, 2026
- AuthInterceptor 剥离 context-path 后再做白名单判断,避免配置 context-path 后登录/首页等接口被 401 拦截
- 新增 ContextPathAdvice 通过 @ModelAttribute 注入 contextPath 到视图模型(Thymeleaf 3.1 起 #request 不再默认可用)
- templates/index.html、login.html 注入 window.CONTEXT_PATH,注册 axios 拦截器为 /api/ 请求自动补齐 context path,页面跳转与静态资源路径同步自适应
- vite dev proxy 支持通过 VITE_API_TARGET 指定带 context-path 的后端地址
- AuthInterceptor 剥离 context-path 后再做白名单判断,避免配置 context-path 后登录/首页等接口被 401 拦截 - 新增 ContextPathAdvice 通过 @ModelAttribute 注入 contextPath 到视图模型(Thymeleaf 3.1 起 #request 不再默认可用) - templates/index.html、login.html 注入 window.CONTEXT_PATH,注册 axios 拦截器为 /api/ 请求自动补齐 context path,页面跳转与静态资源路径同步自适应 - vite dev proxy 支持通过 VITE_API_TARGET 指定带 context-path 的后端地址
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.