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);