fix crash on restart due to change #1030
This commit is contained in:
+2
-8
@@ -386,13 +386,7 @@ func (a *ApiService) DeleteToken(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (a *ApiService) GetSingboxConfig(c *gin.Context) {
|
||||
config, err := a.ConfigService.GetConfig("")
|
||||
if err != nil {
|
||||
c.Status(400)
|
||||
c.Writer.WriteString(err.Error())
|
||||
return
|
||||
}
|
||||
rawConfig, err := json.MarshalIndent(config, "", " ")
|
||||
rawConfig, err := a.ConfigService.GetConfig("")
|
||||
if err != nil {
|
||||
c.Status(400)
|
||||
c.Writer.WriteString(err.Error())
|
||||
@@ -400,7 +394,7 @@ func (a *ApiService) GetSingboxConfig(c *gin.Context) {
|
||||
}
|
||||
c.Header("Content-Type", "application/json")
|
||||
c.Header("Content-Disposition", "attachment; filename=config_"+time.Now().Format("20060102-150405")+".json")
|
||||
c.Writer.Write(rawConfig)
|
||||
c.Writer.Write(*rawConfig)
|
||||
}
|
||||
|
||||
func (a *ApiService) GetCheckOutbound(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user