feat: 实现电脑端被控与控制界面

This commit is contained in:
Nixevol
2026-10-12 07:06:49 +08:00
parent 9dcf8f4837
commit 12adf2951f
110 changed files with 12468 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package paths
import (
"os"
"path/filepath"
"runtime"
)
// Dir 是当前用户的本机数据目录。测试可设置 TAPREMLY_HOME。
func Dir() (string, error) {
if d := os.Getenv("TAPREMLY_HOME"); d != "" {
return d, nil
}
if runtime.GOOS == "windows" {
local := os.Getenv("LOCALAPPDATA")
if local == "" {
home, err := os.UserHomeDir()
if err != nil {
return "", err
}
local = filepath.Join(home, "AppData", "Local")
}
return filepath.Join(local, "TapRemly"), nil
}
if x := os.Getenv("XDG_DATA_HOME"); x != "" {
return filepath.Join(x, "tapremly"), nil
}
home, err := os.UserHomeDir()
if err != nil {
return "", err
}
return filepath.Join(home, ".local", "share", "tapremly"), nil
}