Unified · Split
| @@ -22,6 +22,7 @@ import ( · 21 unmodified lines | ||
| 22 | 22 | const ( |
| 23 | 23 | DefaultPanelGitHubRepository = "https://github.com/router-for-me/Cli-Proxy-API-Management-Center" |
| 24 | 24 | DefaultPprofAddr = "127.0.0.1:8316" |
| 25 | + DefaultAuthDir = "~/.cli-proxy-api" | |
| 25 | 26 | ) |
| 26 | 27 | |
| 27 | 28 | // Config represents the application's configuration, loaded from a YAML file. |
| @@ -73,9 +73,10 @@ func SetLogLevel(cfg *config.Config) { · 72 unmodified lines | ||
| 73 | 73 | |
| 74 | 74 | // ResolveAuthDir normalizes the auth directory path for consistent reuse throughout the app. |
| 75 | 75 | // It expands a leading tilde (~) to the user's home directory and returns a cleaned path. |
| 76 | +// If authDir is empty, it defaults to ~/.cli-proxy-api. | |
| 76 | 77 | func ResolveAuthDir(authDir string) (string, error) { |
| 77 | 78 | if authDir == "" { |
| 78 | − return "", nil | |
| 79 | + authDir = config.DefaultAuthDir | |
| 79 | 80 | } |
| 80 | 81 | if strings.HasPrefix(authDir, "~") { |
| 81 | 82 | home, err := os.UserHomeDir() |