Skip to content

Commit

Permalink
删除用户自动重启trojan
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Mar 8, 2021
1 parent 9a83828 commit 3a7981c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions trojan/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func DelUser() {
}
if mysql.DeleteUser(userList[choice-1].ID) == nil {
fmt.Println("删除用户成功!")
Restart()
}
}

Expand Down
2 changes: 2 additions & 0 deletions web/controller/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ func DelUser(id uint) *ResponseBody {
mysql := core.GetMysql()
if err := mysql.DeleteUser(id); err != nil {
responseBody.Msg = err.Error()
} else {
trojan.Restart()
}
return &responseBody
}
Expand Down

0 comments on commit 3a7981c

Please sign in to comment.