2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-05 15:57:17 +08:00

refactor: 重构 tools.Remove 函数

This commit is contained in:
耗子
2023-11-14 02:16:18 +08:00
parent 83cbae034c
commit f7d65fc22e
14 changed files with 80 additions and 35 deletions

View File

@@ -192,7 +192,9 @@ func (r *S3fsController) Delete(ctx http.Context) http.Response {
if mountCheck, err := tools.Exec("mount -a 2>&1"); err != nil {
return controllers.Error(ctx, http.StatusInternalServerError, "检测到/etc/fstab有误: "+mountCheck)
}
tools.Remove("/etc/passwd-s3fs-" + cast.ToString(mount.ID))
if err := tools.Remove("/etc/passwd-s3fs-" + cast.ToString(mount.ID)); err != nil {
return controllers.Error(ctx, http.StatusInternalServerError, err.Error())
}
var newS3fsList []S3fsMount
for _, s := range s3fsList {