From 981f4570fddc7870a6bc25872b78658906fdb745 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 19 Apr 2023 09:53:46 +0800 Subject: [PATCH 1/2] :bug: After modifying the access authentication code on the browser side, the other side does not refresh Fix https://github.com/siyuan-note/siyuan/issues/8028 --- kernel/api/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/api/router.go b/kernel/api/router.go index 3ad7c09c1..ff9fca169 100644 --- a/kernel/api/router.go +++ b/kernel/api/router.go @@ -52,7 +52,7 @@ func ServeAPI(ginServer *gin.Engine) { ginServer.Handle("POST", "/api/system/setAppearanceMode", model.CheckAuth, setAppearanceMode) ginServer.Handle("POST", "/api/system/getSysFonts", model.CheckAuth, getSysFonts) ginServer.Handle("POST", "/api/system/exit", model.CheckAuth, exit) - ginServer.Handle("POST", "/api/system/setUILayout", model.CheckAuth, setUILayout) + ginServer.Handle("POST", "/api/system/setUILayout", setUILayout) // 这里不加鉴权 After modifying the access authentication code on the browser side, the other side does not refresh https://github.com/siyuan-note/siyuan/issues/8028 ginServer.Handle("POST", "/api/system/getConf", model.CheckAuth, getConf) ginServer.Handle("POST", "/api/system/checkUpdate", model.CheckAuth, checkUpdate) ginServer.Handle("POST", "/api/system/exportLog", model.CheckAuth, exportLog) From 234cc520ae748d6d2b9d3d407322e617b0bfe414 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 19 Apr 2023 10:10:55 +0800 Subject: [PATCH 2/2] :art: Improve `Convert network images to local images` success rate Fix https://github.com/siyuan-note/siyuan/issues/8040 --- kernel/model/assets.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/model/assets.go b/kernel/model/assets.go index 28e17a50f..9dbc95741 100644 --- a/kernel/model/assets.go +++ b/kernel/model/assets.go @@ -140,7 +140,9 @@ func NetImg2LocalAssets(rootID, originalURL string) (err error) { } util.PushUpdateMsg(msgId, fmt.Sprintf(Conf.Language(119), u), 15000) request := httpclient.NewBrowserRequest() - request.SetHeader("Referer", originalURL) // 改进浏览器剪藏扩展转换本地图片成功率 https://github.com/siyuan-note/siyuan/issues/7464 + if "" != originalURL { + request.SetHeader("Referer", originalURL) // 改进浏览器剪藏扩展转换本地图片成功率 https://github.com/siyuan-note/siyuan/issues/7464 + } resp, reqErr := request.Get(u) if nil != reqErr { logging.LogErrorf("download net img [%s] failed: %s", u, reqErr)