fix: complete mobile and session interactions

This commit is contained in:
OpenClaw Agent
2026-09-22 04:21:59 +08:00
parent 16bc14f61b
commit beeee8191b
4 changed files with 25 additions and 10 deletions
+7 -3
View File
@@ -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, "/")