Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Mar 23, 2020
1 parent 5f3d6ee commit a4ac41e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion core/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a4ac41e

Please sign in to comment.