mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-17 04:43:02 +00:00
0.0 前端优化,302标识短链添加/d前缀
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package cn.qaiu.lz.web.controller;
|
||||
|
||||
|
||||
import cn.qaiu.vx.core.annotaions.RouteHandler;
|
||||
import cn.qaiu.vx.core.annotaions.RouteMapping;
|
||||
import cn.qaiu.vx.core.enums.RouteMethod;
|
||||
import io.vertx.ext.web.RoutingContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RouteHandler(value = "/d", order = 99)
|
||||
@Slf4j
|
||||
public class DownRedirect {
|
||||
@RouteMapping(value = "/:type/:key", method = RouteMethod.GET)
|
||||
public void parseKey(RoutingContext ctx, String type, String key) {
|
||||
ctx.reroute("/" + type + "/" + key);
|
||||
}
|
||||
}
|
||||
@@ -68,12 +68,12 @@ public class ParserApi {
|
||||
|
||||
private static String getDownLink(ParserCreate create, boolean isJson) {
|
||||
|
||||
String linkPrefix = SharedDataUtil.getJsonConfig("server")
|
||||
.getString("domainName");
|
||||
String linkPrefix = SharedDataUtil.getJsonConfig("server").getString("domainName");
|
||||
if (StringUtils.isBlank(linkPrefix)) {
|
||||
linkPrefix = "http://127.0.0.1";
|
||||
}
|
||||
return linkPrefix + (isJson ? "/json/" : "/") + create.genPathSuffix();
|
||||
// 下载短链前缀 /d
|
||||
return linkPrefix + (isJson ? "/json/" : "/d/") + create.genPathSuffix();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user