From 9438021a08ce59385fe6d76ea56559237a21e1a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com>
Date: Fri, 6 Sep 2024 13:12:18 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E7=AB=99=EF=BC=9A=E9=A1=B6=E7=BA=A7?=
=?UTF-8?q?=E5=9F=9F=E5=90=8D=E6=94=B9=E4=B8=BA=E8=87=AA=E5=AE=9A=E4=B9=89?=
=?UTF-8?q?=E5=9F=9F=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/layout/index.vue | 23 ++++----
src/utils/common.ts | 4 +-
src/utils/domain.ts | 8 ++-
.../navigation/components/navigation-edit.vue | 3 +-
src/views/cms/navigation/index.vue | 56 +++++++++----------
.../cms/website/components/websiteEdit.vue | 42 ++++++--------
src/views/cms/website/index.vue | 8 +++
7 files changed, 73 insertions(+), 71 deletions(-)
diff --git a/src/layout/index.vue b/src/layout/index.vue
index ff0f785..2a7f424 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -49,14 +49,16 @@
-
+
@@ -118,7 +120,6 @@
setHomeComponents
} from '@/utils/page-tab-util';
import type { TabCtxMenuOption } from 'ele-admin-pro/es/ele-pro-layout/types';
- import { openUrl } from '@/utils/common';
const { push } = useRouter();
const { t, locale } = useI18n();
@@ -128,9 +129,7 @@
// 租户信息
const { company } = storeToRefs(tenantStore);
// 网站名称
- const projectName = !company.value?.companyLogo
- ? company.value?.shortName
- : '';
+ const projectName = company.value?.shortName || 'WEBSOFT';
// 网站LOGO
const logoPath =
company.value?.companyLogo || 'https://www.gxwebsoft.com/ws-logo.svg';
diff --git a/src/utils/common.ts b/src/utils/common.ts
index f28e695..7756eaf 100644
--- a/src/utils/common.ts
+++ b/src/utils/common.ts
@@ -70,7 +70,6 @@ export function openUrl(url: string, params?: any): void {
*/
export function openSpmUrl(path: string, d?: any, id = 0): void {
const domain = getSiteDomain();
- console.log(domain);
const spm = ref('');
const token = ref();
const url = ref();
@@ -98,7 +97,8 @@ export function openSpmUrl(path: string, d?: any, id = 0): void {
// 跳转页面
url.value = `${domain}${path}${spm.value}${token.value}`;
- window.open(`https://${url.value}`);
+ console.log(url.value,'domain>>>>');
+ window.open(`${url.value}`);
}
/**
diff --git a/src/utils/domain.ts b/src/utils/domain.ts
index 1fdb318..bad0312 100644
--- a/src/utils/domain.ts
+++ b/src/utils/domain.ts
@@ -113,8 +113,12 @@ export function getSiteDomain(): string {
listWebsite({ limit: 1 }).then((list) => {
if (list.length > 0) {
const d = list[0];
- localStorage.setItem('Domain', `${d.prefix}${d.domain}`);
- return `${d.prefix}${d.domain}`;
+ if (d.domain) {
+ localStorage.setItem('Domain', `https://${d.domain}`);
+ } else {
+ localStorage.setItem('Domain', `https://$${d.websiteCode}.wsdns.cn`);
+ }
+ return localStorage.getItem('Domain');
}
});
}
diff --git a/src/views/cms/navigation/components/navigation-edit.vue b/src/views/cms/navigation/components/navigation-edit.vue
index 93b2d65..6cd2975 100644
--- a/src/views/cms/navigation/components/navigation-edit.vue
+++ b/src/views/cms/navigation/components/navigation-edit.vue
@@ -372,7 +372,8 @@
.validate()
.then(() => {
const navigationForm = {
- ...form
+ ...form,
+ parentId: form.parentId || 0
};
const saveOrUpdate = isUpdate.value ? updateNavigation : addNavigation;
saveOrUpdate(navigationForm)
diff --git a/src/views/cms/navigation/index.vue b/src/views/cms/navigation/index.vue
index f36a051..0a5c782 100644
--- a/src/views/cms/navigation/index.vue
+++ b/src/views/cms/navigation/index.vue
@@ -139,7 +139,6 @@
@@ -369,37 +368,37 @@
// return;
// }
// TODO 单页模型
- if (row?.model == 'custom') {
- router.push({
- path: `/cms/design`,
- query: {
- id: row.navigationId,
- type: row.model
- }
- });
- return;
- }
+ // if (row?.model == 'custom') {
+ // router.push({
+ // path: `/cms/design`,
+ // query: {
+ // id: row.navigationId,
+ // type: row.model
+ // }
+ // });
+ // return;
+ // }
// TODO 文章列表
- if (row?.model === 'article') {
- router.push({
- path: `/cms/article`,
- query: {
- id: row.navigationId,
- type: row.model
- }
- });
- return;
- }
+ // if (row?.model === 'article') {
+ // router.push({
+ // path: `/cms/article`,
+ // query: {
+ // id: row.navigationId,
+ // type: row.model
+ // }
+ // });
+ // return;
+ // }
// TODO 产品列表
- if (row?.model === 'product') {
- router.push({
- path: '/goods/index',
- query: { categoryId: row.navigationId, type: row.type }
- });
- return;
- }
+ // if (row?.model === 'product') {
+ // router.push({
+ // path: '/goods/index',
+ // query: { categoryId: row.navigationId, type: row.type }
+ // });
+ // return;
+ // }
};
const openLayout = (row?: Navigation) => {
@@ -410,6 +409,7 @@
/* 删除单个 */
const remove = (row: Navigation) => {
+ console.log(row);
if (row.children?.length) {
message.error('请先删除子节点');
return;
diff --git a/src/views/cms/website/components/websiteEdit.vue b/src/views/cms/website/components/websiteEdit.vue
index 6273f7c..68a369f 100644
--- a/src/views/cms/website/components/websiteEdit.vue
+++ b/src/views/cms/website/components/websiteEdit.vue
@@ -35,7 +35,7 @@
v-model:value="form.websiteName"
/>
-
+
-
-
-
-
-
-
-
+
+
+
([
- {
- value: '企业官网',
- label: '企业官网'
- },
- {
- value: '门户网站',
- label: '门户网站'
- },
- {
- value: '电子商城',
- label: '电子商城'
- }
- ]);
-
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
@@ -334,7 +319,8 @@
.then(() => {
loading.value = true;
const formData = {
- ...form
+ ...form,
+ tenantId: localStorage.getItem('TenantId')
};
const saveOrUpdate = isUpdate.value ? updateWebsite : addWebsite;
saveOrUpdate(formData)
@@ -342,7 +328,11 @@
loading.value = false;
message.success(msg);
updateVisible(false);
- localStorage.setItem('Domain', `${form.websiteCode}.wsdns.cn`);
+ if (form.domain) {
+ localStorage.setItem('Domain', `https://${form.domain}`);
+ } else {
+ localStorage.setItem('Domain', `${form.websiteCode}.wsdns.cn`);
+ }
emit('done');
})
.catch((e) => {
diff --git a/src/views/cms/website/index.vue b/src/views/cms/website/index.vue
index 103d830..781ba4b 100644
--- a/src/views/cms/website/index.vue
+++ b/src/views/cms/website/index.vue
@@ -29,7 +29,15 @@
+ {{ record.domain }}
+
+