From 81fa34607315e35ec738c8c2bacc1021f9d0789e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 7 Mar 2023 09:14:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20API=20`/asset/upload`=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=AD=90=E6=96=87=E4=BB=B6=E5=A4=B9=E6=97=B6=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=BB=93=E6=9E=9C=E4=B8=8D=E6=AD=A3=E7=A1=AE=20https:?= =?UTF-8?q?//github.com/siyuan-note/siyuan/issues/7454?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/upload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/model/upload.go b/kernel/model/upload.go index a3456263b..966c05490 100644 --- a/kernel/model/upload.go +++ b/kernel/model/upload.go @@ -189,7 +189,7 @@ func Upload(c *gin.Context) { break } f.Close() - succMap[baseName] = path.Join(relAssetsDirPath, fName) + succMap[baseName] = strings.TrimPrefix(path.Join(relAssetsDirPath, fName), "/") } } From 9ce3cb75c6de460ce035061b10b6359bc26fdb7c Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 7 Mar 2023 09:49:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:art:=20=E5=8A=A0=E5=85=A5=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E4=BF=A1=E6=81=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/conf.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/model/conf.go b/kernel/model/conf.go index 3aee764c8..4523e09db 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -19,7 +19,6 @@ package model import ( "bytes" "fmt" - "github.com/88250/lute/ast" "os" "path/filepath" "runtime" @@ -31,6 +30,7 @@ import ( "github.com/88250/gulu" "github.com/88250/lute" + "github.com/88250/lute/ast" "github.com/Xuanwo/go-locale" humanize "github.com/dustin/go-humanize" "github.com/getsentry/sentry-go" @@ -40,6 +40,7 @@ import ( "github.com/siyuan-note/siyuan/kernel/sql" "github.com/siyuan-note/siyuan/kernel/treenode" "github.com/siyuan-note/siyuan/kernel/util" + "golang.org/x/mod/semver" "golang.org/x/text/language" ) @@ -213,6 +214,11 @@ func InitConf() { Conf.System = conf.NewSystem() Conf.OpenHelp = true } else { + if 0 < semver.Compare("v"+util.Ver, "v"+Conf.System.KernelVersion) { + logging.LogInfof("upgraded from version [%s] to [%s]", Conf.System.KernelVersion, util.Ver) + } else { + logging.LogInfof("downgraded from version [%s] to [%s]", Conf.System.KernelVersion, util.Ver) + } Conf.OpenHelp = Conf.System.KernelVersion != util.Ver Conf.System.KernelVersion = util.Ver Conf.System.IsInsider = util.IsInsider