Private
Public Access
1
0
Files
u-desk/internal/common/path.go
绝尘 eb2cbad17b 优化:代码质量提升,修复重复逻辑和语法高亮支持
- 简化计算属性,删除重复代码
- 优化文件扩展名获取逻辑
- 新增文件工具函数库 fileHelpers.js
- 增强 CodeEditor 语法高亮(支持 30+ 语言)
- 修复 Office 文档文件服务器访问权限
- 添加特殊文件名支持(Dockerfile、Makefile 等)
2026-01-30 02:29:51 +08:00

27 lines
479 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package common
import (
"os"
"path/filepath"
)
const (
// AppName 应用名称
AppName = "u-desk"
// AppDataDir 应用数据目录名称(带点号,表示隐藏目录)
AppDataDir = ".u-desk"
)
// GetUserDataDir 获取用户数据目录
// 跨平台支持Windows、macOS、Linux
// 所有平台统一使用: ~/.u-desk
func GetUserDataDir() string {
homeDir, err := os.UserHomeDir()
if err != nil {
return "."
}
return filepath.Join(homeDir, AppDataDir)
}