0.0 前端优化,302标识短链添加/d前缀

This commit is contained in:
qaiu
2024-10-28 14:36:39 +08:00
parent 05039ece51
commit 155e88223c
11 changed files with 41 additions and 17 deletions

View File

@@ -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);
}
}

View File

@@ -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();
}
}

View File

@@ -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:

View File

@@ -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

View File

@@ -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