mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-16 12:23:03 +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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ server:
|
||||
# 使用数据库
|
||||
enableDatabase: true
|
||||
# 服务域名或者IP 生成二维码链接时需要
|
||||
domainName: https://lz.qaiu.top
|
||||
domainName: http://127.0.0.1:6401
|
||||
|
||||
# 反向代理服务器配置路径(不用加后缀)
|
||||
proxyConf: server-proxy
|
||||
@@ -40,11 +40,13 @@ dataSource:
|
||||
username: root
|
||||
password: '123456'
|
||||
|
||||
# 缓存配置
|
||||
# 直链缓存相关配置
|
||||
cache:
|
||||
# 该配置未使用,后续加入其他Cache实现时,区分类型
|
||||
type: h2db
|
||||
# 默认时长: 单位分钟, 实际有效期分钟-1
|
||||
# 默认时长: 单位分钟,大部分网盘未严格验证,建议不要太大
|
||||
defaultDuration: 59
|
||||
# 具体网盘的缓存配置,如果不加配置则不缓存,每次请求都会请求网盘API,格式:网盘标识: 时长
|
||||
duration:
|
||||
ce:
|
||||
cow:
|
||||
|
||||
@@ -11,7 +11,7 @@ GET http://127.0.0.1:6400/json/parser?url=https://wwsd.lanzoue.com/iLany1e9bbbi
|
||||
GET http://127.0.0.1:6400/json/lz/i6SqHmp1yfc
|
||||
### 蓝奏云https://acgtools.lanzoui.com/iUr7Qnu3sxc https://wwn.lanzouy.com/tp/ihLkw1gezutg https://wwn.lanzouy.com/ihLkw1gezutg
|
||||
# @no-redirect
|
||||
GET http://127.0.0.1:6400/lz/ihLkw1gezutg
|
||||
GET http://127.0.0.1:6400/d/lz/ihLkw1gezutg
|
||||
|
||||
### 蓝奏云
|
||||
# @no-redirect
|
||||
|
||||
@@ -15,7 +15,7 @@ proxy:
|
||||
# 1.origin代理地址端口后有目录(包括 / ),转发后地址:代理地址+访问URL目录部分去除location匹配目录
|
||||
# 2.origin代理地址端口后无任何,转发后地址:代理地址+访问URL目录部
|
||||
location:
|
||||
- path: ~^/(json/|v2/|parser|ye/|lz/|cow/|ec/|fj/|fc/|le/|qq/|ws/|iz/|ce|mne|mqq|mkg/).*
|
||||
- path: ~^/(json/|v2/|d/|parser|ye/|lz/|cow/|ec/|fj/|fc/|le/|qq/|ws/|iz/|ce/).*
|
||||
origin: 127.0.0.1:6400
|
||||
|
||||
# json/parser -> xxx/parser
|
||||
|
||||
Reference in New Issue
Block a user