Compare commits

...

3 Commits
3.8.2 ... 3.8.3

Author SHA1 Message Date
Aaron Liu
88409cc1f0 release: 3.8.3 2023-10-07 20:08:38 +08:00
Darren Yu
cd6eee0b60 Fix: doc preview src of local storage policy starts with ":/" (#1842) (#1844)
* Fix: doc preview src of local storage policy starts with ":/"

* Fix: doc preview src of local storage policy starts with ":/"
2023-10-06 12:34:49 +08:00
Sam
3ffce1e356 fix(admin): Able to change deafult user status (#1811) 2023-08-14 13:24:58 +08:00
4 changed files with 17 additions and 6 deletions

2
assets

Submodule assets updated: b993b4283e...5d4d01a797

View File

@@ -1,13 +1,13 @@
package conf
// BackendVersion 当前后端版本号
var BackendVersion = "3.8.2"
var BackendVersion = "3.8.3"
// RequiredDBVersion 与当前版本匹配的数据库版本
var RequiredDBVersion = "3.8.1"
// RequiredStaticVersion 与当前版本匹配的静态资源版本
var RequiredStaticVersion = "3.8.1"
var RequiredStaticVersion = "3.8.3"
// IsPro 是否为Pro版本
var IsPro = "false"

View File

@@ -112,8 +112,13 @@ func (service *AddUserService) Add() serializer.Response {
user.TwoFactor = service.User.TwoFactor
// 检查愚蠢操作
if user.ID == 1 && user.GroupID != 1 {
return serializer.Err(serializer.CodeChangeGroupForDefaultUser, "", nil)
if user.ID == 1 {
if user.GroupID != 1 {
return serializer.Err(serializer.CodeChangeGroupForDefaultUser, "", nil)
}
if user.Status != model.Active {
return serializer.Err(serializer.CodeInvalidActionOnDefaultUser, "", nil)
}
}
if err := model.DB.Save(&user).Error; err != nil {

View File

@@ -227,8 +227,14 @@ func (service *FileIDService) CreateDocPreviewSession(ctx context.Context, c *gi
return serializer.Err(serializer.CodeNotSet, err.Error(), err)
}
// For newer version of Cloudreve - Local Policy
// When do not use a cdn, the downloadURL withouts hosts, like "/api/v3/file/download/xxx"
if strings.HasPrefix(downloadURL, "/") {
downloadURL = path.Join(model.GetSiteURL().String(), downloadURL)
downloadURI, err := url.Parse(downloadURL)
if err != nil {
return serializer.Err(serializer.CodeNotSet, err.Error(), err)
}
downloadURL = model.GetSiteURL().ResolveReference(downloadURI).String()
}
var resp serializer.DocPreviewSession