🐛 fix can't delete and get meta

This commit is contained in:
微凉
2021-11-13 17:10:44 +08:00
parent 5f34b8ab80
commit 48a65784c7
4 changed files with 25 additions and 13 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/Xhofe/alist/drivers"
"github.com/Xhofe/alist/model"
"github.com/gin-gonic/gin"
"strconv"
"time"
)
@ -73,8 +74,13 @@ func SaveAccount(c *gin.Context) {
}
func DeleteAccount(c *gin.Context) {
name := c.Query("name")
if err := model.DeleteAccount(name); err != nil {
idStr := c.Query("id")
id, err := strconv.Atoi(idStr)
if err != nil {
ErrorResp(c, err, 400)
return
}
if err := model.DeleteAccount(uint(id)); err != nil {
ErrorResp(c, err, 500)
return
}