From beeee8191bea14f67b7f5a8d4a1bef0054268ad0 Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Tue, 22 Sep 2026 04:21:59 +0800 Subject: [PATCH] fix: complete mobile and session interactions --- internal/api/server.go | 10 +++++++--- internal/api/web/index.html | 13 +++++++------ internal/auth/auth.go | 2 +- internal/auth/auth_test.go | 10 ++++++++++ 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/internal/api/server.go b/internal/api/server.go index 34a2a14..70036bc 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -569,15 +569,19 @@ type accessibleRoot struct { func (s *Server) roots(w http.ResponseWriter, r *http.Request) { a := account(r, s) - if a == nil || a.Username == "" { + if a == nil { writeJSONError(w, http.StatusUnauthorized, "not authenticated") return } seen := map[string]bool{} out := make([]accessibleRoot, 0) - if a.Admin && a.MaskFor("").HasRead() { + if a.MaskFor("").HasRead() { seen[""] = true - out = append(out, accessibleRoot{Path: "", Name: "全部文件", Mask: permString(a.MaskFor("")), Home: false}) + name := "共享文件" + if a.Admin { + name = "全部文件" + } + out = append(out, accessibleRoot{Path: "", Name: name, Mask: permString(a.MaskFor("")), Home: false}) } if a.Home != "" && a.MaskFor(a.Home).HasRead() { home := strings.Trim(a.Home, "/") diff --git a/internal/api/web/index.html b/internal/api/web/index.html index 1311ca1..b9824a9 100644 --- a/internal/api/web/index.html +++ b/internal/api/web/index.html @@ -46,7 +46,7 @@ button.ghost{background:var(--surface2);color:var(--text)}button.danger{backgrou