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

refactor: 使用中间件判断安装状态

This commit is contained in:
耗子
2023-11-20 01:20:19 +08:00
parent 4b4c2c4a0b
commit 6b36e1659c
21 changed files with 90 additions and 1264 deletions

View File

@@ -21,11 +21,6 @@ func NewPhpMyAdminController() *PhpMyAdminController {
}
func (r *PhpMyAdminController) Info(ctx http.Context) http.Response {
check := controllers.Check(ctx, "phpmyadmin")
if check != nil {
return check
}
files, err := os.ReadDir("/www/server/phpmyadmin")
if err != nil {
return controllers.Error(ctx, http.StatusInternalServerError, "找不到 phpMyAdmin 目录")
@@ -57,11 +52,6 @@ func (r *PhpMyAdminController) Info(ctx http.Context) http.Response {
}
func (r *PhpMyAdminController) SetPort(ctx http.Context) http.Response {
check := controllers.Check(ctx, "phpmyadmin")
if check != nil {
return check
}
port := ctx.Request().Input("port")
if len(port) == 0 {
return controllers.Error(ctx, http.StatusInternalServerError, "端口不能为空")