From d5674917703c5445c1421e3994b3bc6b55948835 Mon Sep 17 00:00:00 2001
From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com>
Date: Tue, 12 Dec 2023 12:08:07 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=9F=9F=E5=90=8D?=
=?UTF-8?q?=E9=9D=9E=2080=20=E7=AB=AF=E5=8F=A3=E6=97=B6=E5=BF=AB=E9=80=9F?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=9C=B0=E5=9D=80=E9=94=99=E8=AF=AF=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98=20(#3281)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../website/config/basic/domain/index.vue | 27 +++++++++++++++----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/frontend/src/views/website/website/config/basic/domain/index.vue b/frontend/src/views/website/website/config/basic/domain/index.vue
index 8b1348880..58e4be156 100644
--- a/frontend/src/views/website/website/config/basic/domain/index.vue
+++ b/frontend/src/views/website/website/config/basic/domain/index.vue
@@ -5,7 +5,7 @@
-
+
@@ -31,6 +31,7 @@ import { computed, onMounted, ref } from 'vue';
import i18n from '@/lang';
import { Promotion } from '@element-plus/icons-vue';
import { GlobalStore } from '@/store';
+import { CheckAppInstalled } from '@/api/modules/app';
const globalStore = GlobalStore();
const props = defineProps({
@@ -50,6 +51,8 @@ const data = ref([]);
const domainRef = ref();
const website = ref();
const opRef = ref();
+const httpPort = ref(80);
+const httpsPort = ref(443);
const buttons = [
{
@@ -67,10 +70,14 @@ const openCreate = () => {
domainRef.value.acceptParams(id.value);
};
-const openUrl = (domain: string, port: string) => {
- let url = website.value.protocol.toLowerCase() + '://' + domain;
- if (port != '80') {
- url = url + ':' + port;
+const openUrl = (domain: Website.Domain) => {
+ const protocol = website.value.protocol.toLowerCase();
+ let url = protocol + '://' + domain.domain;
+ if (protocol == 'http' && domain.port != 80) {
+ url = url + ':' + domain.port;
+ }
+ if (protocol == 'https') {
+ url = url + ':' + httpsPort.value;
}
window.open(url);
};
@@ -97,6 +104,7 @@ const search = (id: number) => {
.finally(() => {
loading.value = false;
});
+ onCheck();
};
const getWebsite = (id: number) => {
@@ -105,6 +113,15 @@ const getWebsite = (id: number) => {
});
};
+const onCheck = async () => {
+ await CheckAppInstalled('openresty', '')
+ .then((res) => {
+ httpPort.value = res.data.httpPort;
+ httpsPort.value = res.data.httpsPort;
+ })
+ .catch(() => {});
+};
+
onMounted(() => {
search(id.value);
getWebsite(id.value);