fix: 修复 /json/parser 路由优先级问题

- 将 /json/parser 路由的 order 从 -1 改为 2000
- 确保优先于通配符路由 /json/:type/:key (order=1000) 注册
- 修复了接口返回 500 错误的问题
This commit is contained in:
q
2026-01-14 14:35:21 +08:00
parent 0f28dc2896
commit 55c3387415

View File

@@ -42,7 +42,8 @@ public class ServerApi {
return promise.future(); return promise.future();
} }
@RouteMapping(value = "/json/parser", method = RouteMethod.GET, order = 1) // order=2000 确保此路由优先于 /json/:type/:key 匹配(数字越大越先注册)
@RouteMapping(value = "/json/parser", method = RouteMethod.GET, order = 2000)
public Future<CacheLinkInfo> parseJson(HttpServerRequest request, String pwd) { public Future<CacheLinkInfo> parseJson(HttpServerRequest request, String pwd) {
String url = URLParamUtil.parserParams(request); String url = URLParamUtil.parserParams(request);
return cacheService.getCachedByShareUrlAndPwd(url, pwd, JsonObject.of("UA",request.headers().get("user-agent"))); return cacheService.getCachedByShareUrlAndPwd(url, pwd, JsonObject.of("UA",request.headers().get("user-agent")));