添加下载代理接口

This commit is contained in:
junleea 2025-09-06 14:01:34 +08:00
parent e2ebdc0621
commit b1bb1cb734
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ func SetUpToolGroup(router *gin.Engine) {
//发送邮件
toolGroup.POST("/send_mail", SendMailTool)
//下载代理
toolGroup.GET("/dl/:url", DownloadProxyHandle)
toolGroup.GET("/dlp", DownloadProxyHandle)
}
func GetMonitorList(c *gin.Context) {
@ -497,7 +497,7 @@ func DownloadProxyHandle(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"code": proto.ParameterError, "message": "failed, key is null or error"})
}
// 获取URL参数
encodedURL := c.Param("url")
encodedURL := c.Query("url")
if encodedURL == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "URL参数不能为空", "code": proto.ParameterError, "message": "failed"})
return

View File

@ -12,7 +12,7 @@ import (
var Config ConfigStruct
var SigningKey = []byte{}
var Url_map = map[string]bool{"/login": true, "/register": true, "/uuid": true, "/gqr": true, "/cid/callback": true, "/tool/monitor": true, "/user/sync": true, "/tool/file/": true, "/user/reset": true} // 不需要token验证的url
var Url_map = map[string]bool{"/login": true, "/register": true, "/uuid": true, "/gqr": true, "/cid/callback": true, "/tool/monitor": true, "/user/sync": true, "/tool/file/": true, "/user/reset": true, "/tool/dlp": true} // 不需要token验证的url
var Per_menu_map = map[string]int{"/video/": 1, "/device/": 2, "/cid/": 3}
var File_Type = map[string]int{"im": 1, "avatar": 2, "file": 3, "config": 4} // 文件类型