🎨 Windows/macOS add a option Settings - About - Access authorization code - Follow system lock screen https://github.com/siyuan-note/siyuan/issues/9087

This commit is contained in:
Daniel 2023-09-04 09:05:03 +08:00
parent 300958670a
commit 4ddef21aa6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 17 additions and 0 deletions

View file

@ -38,6 +38,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/system/getEmojiConf", model.CheckAuth, getEmojiConf) ginServer.Handle("POST", "/api/system/getEmojiConf", model.CheckAuth, getEmojiConf)
ginServer.Handle("POST", "/api/system/setAccessAuthCode", model.CheckAuth, model.CheckReadonly, setAccessAuthCode) ginServer.Handle("POST", "/api/system/setAccessAuthCode", model.CheckAuth, model.CheckReadonly, setAccessAuthCode)
ginServer.Handle("POST", "/api/system/setFollowSystemLockScreen", model.CheckAuth, model.CheckReadonly, setFollowSystemLockScreen)
ginServer.Handle("POST", "/api/system/setNetworkServe", model.CheckAuth, model.CheckReadonly, setNetworkServe) ginServer.Handle("POST", "/api/system/setNetworkServe", model.CheckAuth, model.CheckReadonly, setNetworkServe)
ginServer.Handle("POST", "/api/system/setUploadErrLog", model.CheckAuth, model.CheckReadonly, setUploadErrLog) ginServer.Handle("POST", "/api/system/setUploadErrLog", model.CheckAuth, model.CheckReadonly, setUploadErrLog)
ginServer.Handle("POST", "/api/system/setAutoLaunch", model.CheckAuth, model.CheckReadonly, setAutoLaunch) ginServer.Handle("POST", "/api/system/setAutoLaunch", model.CheckAuth, model.CheckReadonly, setAutoLaunch)

View file

@ -281,6 +281,22 @@ func setAccessAuthCode(c *gin.Context) {
return return
} }
func setFollowSystemLockScreen(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
lockScreenMode := int(arg["lockScreenMode"].(float64))
model.Conf.System.LockScreenMode = lockScreenMode
model.Conf.Save()
return
}
func getSysFonts(c *gin.Context) { func getSysFonts(c *gin.Context) {
ret := gulu.Ret.NewResult() ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret) defer c.JSON(http.StatusOK, ret)