mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 11:50:15 +01:00
🎨 Improve lock screen interaction https://github.com/siyuan-note/siyuan/issues/17065
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
3e118f2474
commit
498441c4c9
3 changed files with 4 additions and 4 deletions
|
|
@ -581,9 +581,9 @@
|
|||
})
|
||||
|
||||
// 用于授权页保持连接,避免非常驻内存内核自动退出 https://github.com/siyuan-note/insider/issues/1099
|
||||
const ws = new WebSocket((window.location.protocol === 'https:' ? 'wss' : 'ws') + '://' + window.location.host + '/ws?app=siyuan&id=auth')
|
||||
const ws = new WebSocket((window.location.protocol === 'https:' ? 'wss' : 'ws') + '://' + window.location.host + '/ws?app=siyuan' + Math.random().toString(36).substring(8) + '&id=auth&type=auth')
|
||||
ws.onmessage = (event) => {
|
||||
const data = processMessage(JSON.parse(event.data));
|
||||
const data = JSON.parse(event.data);
|
||||
if (data.cmd === "loginAuth") {
|
||||
window.location.href = toPath
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ func LoginAuth(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
util.BroadcastByType("main", "loginAuth", 0, "", nil)
|
||||
util.BroadcastByType("auth", "loginAuth", 0, "", nil)
|
||||
}
|
||||
|
||||
func GetCaptcha(c *gin.Context) {
|
||||
|
|
|
|||
|
|
@ -727,7 +727,7 @@ func serveWebSocket(ginServer *gin.Engine) {
|
|||
|
||||
if !authOk {
|
||||
// 用于授权页保持连接,避免非常驻内存内核自动退出 https://github.com/siyuan-note/insider/issues/1099
|
||||
authOk = strings.Contains(s.Request.RequestURI, "/ws?app=siyuan&id=auth")
|
||||
authOk = strings.Contains(s.Request.RequestURI, "/ws?app=siyuan") && strings.Contains(s.Request.RequestURI, "&id=auth&type=auth")
|
||||
}
|
||||
|
||||
if !authOk {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue