From b7495a63e90c1d64f0c4dd10cf79cdfe0ffbb69e Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 7 Jun 2023 16:09:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=87=AA=E7=AD=BE=E8=AF=81=E4=B9=A6=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=20(#1278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app.go | 8 ++++++- backend/app/service/website.go | 6 ++++- .../views/website/runtime/create/index.vue | 24 +++++++++---------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/backend/app/service/app.go b/backend/app/service/app.go index db6da647d..26620d71a 100644 --- a/backend/app/service/app.go +++ b/backend/app/service/app.go @@ -162,7 +162,13 @@ func (a AppService) GetAppDetail(appId uint, version, appType string) (response. return appDetailDTO, err } fileOp := files.NewFileOp() - buildPath := path.Join(constant.AppResourceDir, app.Key, "versions", detail.Version, "build") + versionPath := path.Join(constant.AppResourceDir, app.Resource, app.Key, detail.Version) + if !fileOp.Stat(versionPath) { + if err = downloadApp(app, detail, nil); err != nil { + return appDetailDTO, err + } + } + buildPath := path.Join(versionPath, "build") paramsPath := path.Join(buildPath, "config.json") if !fileOp.Stat(paramsPath) { return appDetailDTO, buserr.New(constant.ErrFileNotExist) diff --git a/backend/app/service/website.go b/backend/app/service/website.go index f522d4d61..5b5632fa6 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -681,7 +681,11 @@ func (w WebsiteService) OpWebsiteHTTPS(ctx context.Context, req request.WebsiteH websiteSSL.ExpireDate = cert.NotAfter websiteSSL.StartDate = cert.NotBefore websiteSSL.Type = cert.Issuer.CommonName - websiteSSL.Organization = cert.Issuer.Organization[0] + if len(cert.Issuer.Organization) > 0 { + websiteSSL.Organization = cert.Issuer.Organization[0] + } else { + websiteSSL.Organization = cert.Issuer.CommonName + } if len(cert.DNSNames) > 0 { websiteSSL.PrimaryDomain = cert.DNSNames[0] websiteSSL.Domains = strings.Join(cert.DNSNames, ",") diff --git a/frontend/src/views/website/runtime/create/index.vue b/frontend/src/views/website/runtime/create/index.vue index 94a015bc8..14d088ab2 100644 --- a/frontend/src/views/website/runtime/create/index.vue +++ b/frontend/src/views/website/runtime/create/index.vue @@ -213,13 +213,18 @@ const changeApp = (appId: number) => { }; const changeVersion = () => { + loading.value = true; initParam.value = false; - GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime').then((res) => { - runtime.value.appDetailId = res.data.id; - runtime.value.image = res.data.image + ':' + runtime.value.version; - appParams.value = res.data.params; - initParam.value = true; - }); + GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime') + .then((res) => { + runtime.value.appDetailId = res.data.id; + runtime.value.image = res.data.image + ':' + runtime.value.version; + appParams.value = res.data.params; + initParam.value = true; + }) + .finally(() => { + loading.value = false; + }); }; const getApp = (appkey: string, mode: string) => { @@ -228,12 +233,7 @@ const getApp = (appkey: string, mode: string) => { if (res.data.versions.length > 0) { runtime.value.version = res.data.versions[0]; if (mode === 'create') { - GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime').then((res) => { - runtime.value.appDetailId = res.data.id; - runtime.value.image = res.data.image + ':' + runtime.value.version; - appParams.value = res.data.params; - initParam.value = true; - }); + changeVersion(); } else { initParam.value = true; }