From da3cb862a480770e7608305e6c3ecff2974dbff4 Mon Sep 17 00:00:00 2001 From: feng Date: Wed, 10 Jul 2024 08:19:00 +0800 Subject: [PATCH] fix: v3.1.0 --- patches/siyuan/disable-update.patch | 37 ++++++++++++++++------------- patches/siyuan/mock-vip-user.patch | 12 ++++++---- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/patches/siyuan/disable-update.patch b/patches/siyuan/disable-update.patch index b8db4ad..f452082 100644 --- a/patches/siyuan/disable-update.patch +++ b/patches/siyuan/disable-update.patch @@ -1,17 +1,8 @@ -From 5ead51c0bbaf9e90363bf7b125de6e4f11ce5d2d Mon Sep 17 00:00:00 2001 -From: feng -Date: Thu, 17 Aug 2023 13:50:31 +0800 -Subject: [PATCH] feat: disable update - ---- - kernel/api/system.go | 17 +++++++++-------- - 1 file changed, 9 insertions(+), 8 deletions(-) - -diff --git a/kernel/api/system.go b/kernel/api/system.go -index fc23d6800..253bb2b61 100644 ---- a/kernel/api/system.go -+++ b/kernel/api/system.go -@@ -165,16 +165,17 @@ func addCustomEmoji(name string, items *[]map[string]interface{}) { +diff --git forkSrcPrefix/kernel/api/system.go forkDstPrefix/kernel/api/system.go +index 312bcbea50e14045d5b8716a73f5c786dbf95236..f021de720cb177e5cba9257894cbf28dd8d211ee 100644 +--- forkSrcPrefix/kernel/api/system.go ++++ forkDstPrefix/kernel/api/system.go +@@ -184,16 +184,17 @@ func addCustomEmoji(name string, items *[]map[string]interface{}) { } func checkUpdate(c *gin.Context) { @@ -37,6 +28,18 @@ index fc23d6800..253bb2b61 100644 } func exportLog(c *gin.Context) { --- -2.37.5 - +diff --git forkSrcPrefix/kernel/model/mount.go forkDstPrefix/kernel/model/mount.go +index 1ec00f1784be5d89a8ecae59f9807f6da1f20ca5..9dcbddba692ba2af923179eee296b69d403f92d5 100644 +--- forkSrcPrefix/kernel/model/mount.go ++++ forkDstPrefix/kernel/model/mount.go +@@ -223,8 +223,8 @@ func Mount(boxID string) (alreadyMount bool, err error) { + util.PushErrMsg(Conf.Language(52), 7000) + + // 每次打开帮助文档时自动检查版本更新并提醒 https://github.com/siyuan-note/siyuan/issues/5057 +- time.Sleep(time.Second * 10) +- CheckUpdate(true) ++ // time.Sleep(time.Second * 10) ++ // CheckUpdate(true) + }() + } + diff --git a/patches/siyuan/mock-vip-user.patch b/patches/siyuan/mock-vip-user.patch index 21e65e9..783fe29 100644 --- a/patches/siyuan/mock-vip-user.patch +++ b/patches/siyuan/mock-vip-user.patch @@ -1,9 +1,9 @@ diff --git forkSrcPrefix/kernel/api/setting.go forkDstPrefix/kernel/api/setting.go -index 733c4eefd439b34b2856222f3dd0d9cdea56d19c..9d33ff2588aef54d848bb20566659c10be90836f 100644 +index 9010350078560bb298de72bc73d54e51db60f21b..dfe9ab286f50431bdb30c633b8e63886b5046419 100644 --- forkSrcPrefix/kernel/api/setting.go +++ forkDstPrefix/kernel/api/setting.go -@@ -533,7 +533,7 @@ func setAppearance(c *gin.Context) { - ret.Data = model.Conf.Appearance +@@ -586,7 +586,7 @@ func getPublish(c *gin.Context) { + } } -func getCloudUser(c *gin.Context) { @@ -11,7 +11,7 @@ index 733c4eefd439b34b2856222f3dd0d9cdea56d19c..9d33ff2588aef54d848bb20566659c10 ret := gulu.Ret.NewResult() defer c.JSON(http.StatusOK, ret) -@@ -551,6 +551,44 @@ func getCloudUser(c *gin.Context) { +@@ -608,6 +608,48 @@ func getCloudUser(c *gin.Context) { ret.Data = model.Conf.GetUser() } @@ -19,6 +19,10 @@ index 733c4eefd439b34b2856222f3dd0d9cdea56d19c..9d33ff2588aef54d848bb20566659c10 + ret := gulu.Ret.NewResult() + defer c.JSON(http.StatusOK, ret) + ++ if !model.IsAdminRoleContext(c) { ++ return ++ } ++ + user := &conf.User{ + UserId: "0", + UserName: "_",