diff --git a/cmd/root.go b/cmd/root.go index 595b86d4..6521e04a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -52,7 +52,6 @@ exit: fmt.Printf("%d.%-15s\n\n", i+1, menuList[i]) } } - fmt.Println("\n") switch util.LoopInput("请选择: ", menuList, false) { case 1: trojan.ControllMenu() diff --git a/core/mysql.go b/core/mysql.go index f80fcda8..509a602f 100644 --- a/core/mysql.go +++ b/core/mysql.go @@ -82,7 +82,9 @@ func (mysql *Mysql) DeleteUser(id uint) error { db := mysql.GetDB() defer db.Close() userList := *mysql.GetData(strconv.Itoa(int(id))) - _ = DelValue(userList[0].Username + "_pass") + if userList[0].Username != "admin" { + _ = DelValue(userList[0].Username + "_pass") + } if _, err := db.Exec(fmt.Sprintf("DELETE FROM users WHERE id=%d;", id)); err != nil { fmt.Println(err) return err