mirror of https://github.com/cloudreve/Cloudreve
update version number
parent
3b16d7d77c
commit
a31ac2299a
2
assets
2
assets
|
@ -1 +1 @@
|
||||||
Subproject commit e4ccca3e28f2df52646385ef3957e79f4d203f94
|
Subproject commit 1d11ce88ad85cceda1273da9ed8643f1ce3b6ee4
|
|
@ -1,13 +1,13 @@
|
||||||
package conf
|
package conf
|
||||||
|
|
||||||
// BackendVersion 当前后端版本号
|
// BackendVersion 当前后端版本号
|
||||||
var BackendVersion = "3.5.2"
|
var BackendVersion = "3.5.3"
|
||||||
|
|
||||||
// RequiredDBVersion 与当前版本匹配的数据库版本
|
// RequiredDBVersion 与当前版本匹配的数据库版本
|
||||||
var RequiredDBVersion = "3.5.2"
|
var RequiredDBVersion = "3.5.2"
|
||||||
|
|
||||||
// RequiredStaticVersion 与当前版本匹配的静态资源版本
|
// RequiredStaticVersion 与当前版本匹配的静态资源版本
|
||||||
var RequiredStaticVersion = "3.5.2"
|
var RequiredStaticVersion = "3.5.3"
|
||||||
|
|
||||||
// IsPro 是否为Pro版本
|
// IsPro 是否为Pro版本
|
||||||
var IsPro = "false"
|
var IsPro = "false"
|
||||||
|
|
|
@ -3,10 +3,10 @@ package controllers
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
model "github.com/cloudreve/Cloudreve/v3/models"
|
model "github.com/cloudreve/Cloudreve/v3/models"
|
||||||
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem"
|
|
||||||
"github.com/cloudreve/Cloudreve/v3/pkg/request"
|
"github.com/cloudreve/Cloudreve/v3/pkg/request"
|
||||||
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
|
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
|
||||||
"github.com/cloudreve/Cloudreve/v3/service/explorer"
|
"github.com/cloudreve/Cloudreve/v3/service/explorer"
|
||||||
|
@ -102,12 +102,26 @@ func AnonymousPermLink(c *gin.Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSource 获取文件的外链地址
|
|
||||||
func GetSource(c *gin.Context) {
|
func GetSource(c *gin.Context) {
|
||||||
// 创建上下文
|
// 创建上下文
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
var service explorer.ItemIDService
|
||||||
|
if err := c.ShouldBindJSON(&service); err == nil {
|
||||||
|
res := service.Sources(ctx, c)
|
||||||
|
c.JSON(200, res)
|
||||||
|
} else {
|
||||||
|
c.JSON(200, ErrorResponse(err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Thumb 获取文件缩略图
|
||||||
|
func Thumb(c *gin.Context) {
|
||||||
|
// 创建上下文
|
||||||
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
fs, err := filesystem.NewFileSystemFromContext(c)
|
fs, err := filesystem.NewFileSystemFromContext(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(200, serializer.Err(serializer.CodePolicyNotAllowed, err.Error(), err))
|
c.JSON(200, serializer.Err(serializer.CodePolicyNotAllowed, err.Error(), err))
|
||||||
|
@ -121,21 +135,6 @@ func GetSource(c *gin.Context) {
|
||||||
c.JSON(200, serializer.ParamErr("文件不存在", err))
|
c.JSON(200, serializer.ParamErr("文件不存在", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Thumb 获取文件缩略图
|
|
||||||
func Thumb(c *gin.Context) {
|
|
||||||
// 创建上下文
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
var service explorer.ItemIDService
|
|
||||||
if err := c.ShouldBindJSON(&service); err == nil {
|
|
||||||
res := service.Sources(ctx, c)
|
|
||||||
c.JSON(200, res)
|
|
||||||
} else {
|
|
||||||
c.JSON(200, ErrorResponse(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取缩略图
|
// 获取缩略图
|
||||||
resp, err := fs.GetThumb(ctx, fileID.(uint))
|
resp, err := fs.GetThumb(ctx, fileID.(uint))
|
||||||
|
|
Loading…
Reference in New Issue