1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

fix: 解决删除 Openresty 之后网站列表页面报错的问题 (#926)

This commit is contained in:
zhengkunwang223 2023-05-08 14:11:39 +07:00 committed by GitHub
parent 900e141297
commit 54bc33a1a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,13 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
websiteDTOs []response.WebsiteDTO
opts []repo.DBOption
)
nginxInstall, err := getAppInstallByKey(constant.AppOpenresty)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return 0, nil, nil
}
return 0, nil, err
}
opts = append(opts, commonRepo.WithOrderBy("created_at desc"))
if req.Name != "" {
opts = append(opts, websiteRepo.WithDomainLike(req.Name))
@ -97,10 +104,6 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
if err != nil {
return 0, nil, err
}
nginxInstall, err := getAppInstallByKey(constant.AppOpenresty)
if err != nil {
return 0, nil, err
}
for _, web := range websites {
var (
appName string