mirror of
https://github.com/acepanel/panel.git
synced 2026-02-05 17:07:18 +08:00
refactor: 使用中间件判断安装状态
This commit is contained in:
@@ -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, "端口不能为空")
|
||||
|
||||
Reference in New Issue
Block a user