fix generateconfig
This commit is contained in:
parent
b2b9ef41cd
commit
98f6d47bfd
@ -263,6 +263,7 @@ func main() {
|
||||
|
||||
// 下载 Clash 配置
|
||||
authorized.GET("/download", func(c *gin.Context) {
|
||||
service.GenerateConfig()
|
||||
if _, err := os.Stat(clashConfigPath); os.IsNotExist(err) {
|
||||
c.String(http.StatusNotFound, "Clash configuration file not found")
|
||||
return
|
||||
@ -272,6 +273,7 @@ func main() {
|
||||
|
||||
// 将 Clash 配置放入剪贴板
|
||||
authorized.GET("/clipboard", func(c *gin.Context) {
|
||||
service.GenerateConfig()
|
||||
config, err := readClashConfig()
|
||||
if err != nil {
|
||||
c.String(http.StatusInternalServerError, fmt.Sprintf("Error reading Clash config: %v", err))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user