Compare commits

...
4 Commits
Author SHA1 Message Date
EpicMoandGitHub 3edb00a648 fit: gmail (#1949) 2024-02-24 21:36:59 +08:00
Aaron Liu 88409cc1f0 release: 3.8.3 2023-10-07 20:08:38 +08:00
Darren YuandGitHub 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
SamandGitHub 3ffce1e356 fix(admin): Able to change deafult user status (#1811) 2023-08-14 13:24:58 +08:00
5 changed files with 20 additions and 6 deletions
+1 -1
Submodule assets updated: b993b4283e...5d4d01a797
+2 -2
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"
+3
View File
@@ -1,6 +1,8 @@
package email
import (
"fmt"
"github.com/google/uuid"
"time"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
@@ -50,6 +52,7 @@ func (client *SMTP) Send(to, title, body string) error {
m.SetAddressHeader("Reply-To", client.Config.ReplyTo, client.Config.Name)
m.SetHeader("To", to)
m.SetHeader("Subject", title)
m.SetHeader("Message-ID", fmt.Sprintf("<%s@%s>", uuid.NewString(), "cloudreve"))
m.SetBody("text/html", body)
client.ch <- m
return nil
+7 -2
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 {
+7 -1
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