网站:顶级域名改为自定义域名
This commit is contained in:
@@ -49,14 +49,16 @@
|
|||||||
<router-layout />
|
<router-layout />
|
||||||
<!-- logo 图标 -->
|
<!-- logo 图标 -->
|
||||||
<template #logo>
|
<template #logo>
|
||||||
<AImage
|
<div class="sys-logo mr-2 flex items-center flex-col">
|
||||||
v-if="logoPath"
|
<AAvatar
|
||||||
:preview="false"
|
shape="square"
|
||||||
:style="{ width: '100px', height: '30px' }"
|
:preview="false"
|
||||||
:src="logoPath"
|
:size="28"
|
||||||
@click="openUrl(`/system/profile`)"
|
:src="logoPath"
|
||||||
alt="logo"
|
@click="push(`/system/profile`)"
|
||||||
/>
|
alt="logo"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- 顶栏右侧区域 -->
|
<!-- 顶栏右侧区域 -->
|
||||||
<template #right>
|
<template #right>
|
||||||
@@ -118,7 +120,6 @@
|
|||||||
setHomeComponents
|
setHomeComponents
|
||||||
} from '@/utils/page-tab-util';
|
} from '@/utils/page-tab-util';
|
||||||
import type { TabCtxMenuOption } from 'ele-admin-pro/es/ele-pro-layout/types';
|
import type { TabCtxMenuOption } from 'ele-admin-pro/es/ele-pro-layout/types';
|
||||||
import { openUrl } from '@/utils/common';
|
|
||||||
|
|
||||||
const { push } = useRouter();
|
const { push } = useRouter();
|
||||||
const { t, locale } = useI18n();
|
const { t, locale } = useI18n();
|
||||||
@@ -128,9 +129,7 @@
|
|||||||
// 租户信息
|
// 租户信息
|
||||||
const { company } = storeToRefs(tenantStore);
|
const { company } = storeToRefs(tenantStore);
|
||||||
// 网站名称
|
// 网站名称
|
||||||
const projectName = !company.value?.companyLogo
|
const projectName = company.value?.shortName || 'WEBSOFT';
|
||||||
? company.value?.shortName
|
|
||||||
: '';
|
|
||||||
// 网站LOGO
|
// 网站LOGO
|
||||||
const logoPath =
|
const logoPath =
|
||||||
company.value?.companyLogo || 'https://www.gxwebsoft.com/ws-logo.svg';
|
company.value?.companyLogo || 'https://www.gxwebsoft.com/ws-logo.svg';
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ export function openUrl(url: string, params?: any): void {
|
|||||||
*/
|
*/
|
||||||
export function openSpmUrl(path: string, d?: any, id = 0): void {
|
export function openSpmUrl(path: string, d?: any, id = 0): void {
|
||||||
const domain = getSiteDomain();
|
const domain = getSiteDomain();
|
||||||
console.log(domain);
|
|
||||||
const spm = ref<string>('');
|
const spm = ref<string>('');
|
||||||
const token = ref<string>();
|
const token = ref<string>();
|
||||||
const url = ref<string>();
|
const url = ref<string>();
|
||||||
@@ -98,7 +97,8 @@ export function openSpmUrl(path: string, d?: any, id = 0): void {
|
|||||||
|
|
||||||
// 跳转页面
|
// 跳转页面
|
||||||
url.value = `${domain}${path}${spm.value}${token.value}`;
|
url.value = `${domain}${path}${spm.value}${token.value}`;
|
||||||
window.open(`https://${url.value}`);
|
console.log(url.value,'domain>>>>');
|
||||||
|
window.open(`${url.value}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -113,8 +113,12 @@ export function getSiteDomain(): string {
|
|||||||
listWebsite({ limit: 1 }).then((list) => {
|
listWebsite({ limit: 1 }).then((list) => {
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
const d = list[0];
|
const d = list[0];
|
||||||
localStorage.setItem('Domain', `${d.prefix}${d.domain}`);
|
if (d.domain) {
|
||||||
return `${d.prefix}${d.domain}`;
|
localStorage.setItem('Domain', `https://${d.domain}`);
|
||||||
|
} else {
|
||||||
|
localStorage.setItem('Domain', `https://$${d.websiteCode}.wsdns.cn`);
|
||||||
|
}
|
||||||
|
return localStorage.getItem('Domain');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -372,7 +372,8 @@
|
|||||||
.validate()
|
.validate()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const navigationForm = {
|
const navigationForm = {
|
||||||
...form
|
...form,
|
||||||
|
parentId: form.parentId || 0
|
||||||
};
|
};
|
||||||
const saveOrUpdate = isUpdate.value ? updateNavigation : addNavigation;
|
const saveOrUpdate = isUpdate.value ? updateNavigation : addNavigation;
|
||||||
saveOrUpdate(navigationForm)
|
saveOrUpdate(navigationForm)
|
||||||
|
|||||||
@@ -139,7 +139,6 @@
|
|||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
placement="topRight"
|
placement="topRight"
|
||||||
:disabled="record.home == 1"
|
|
||||||
title="确定要删除此菜单吗?"
|
title="确定要删除此菜单吗?"
|
||||||
@confirm="remove(record)"
|
@confirm="remove(record)"
|
||||||
>
|
>
|
||||||
@@ -369,37 +368,37 @@
|
|||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// TODO 单页模型
|
// TODO 单页模型
|
||||||
if (row?.model == 'custom') {
|
// if (row?.model == 'custom') {
|
||||||
router.push({
|
// router.push({
|
||||||
path: `/cms/design`,
|
// path: `/cms/design`,
|
||||||
query: {
|
// query: {
|
||||||
id: row.navigationId,
|
// id: row.navigationId,
|
||||||
type: row.model
|
// type: row.model
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// TODO 文章列表
|
// TODO 文章列表
|
||||||
if (row?.model === 'article') {
|
// if (row?.model === 'article') {
|
||||||
router.push({
|
// router.push({
|
||||||
path: `/cms/article`,
|
// path: `/cms/article`,
|
||||||
query: {
|
// query: {
|
||||||
id: row.navigationId,
|
// id: row.navigationId,
|
||||||
type: row.model
|
// type: row.model
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// TODO 产品列表
|
// TODO 产品列表
|
||||||
if (row?.model === 'product') {
|
// if (row?.model === 'product') {
|
||||||
router.push({
|
// router.push({
|
||||||
path: '/goods/index',
|
// path: '/goods/index',
|
||||||
query: { categoryId: row.navigationId, type: row.type }
|
// query: { categoryId: row.navigationId, type: row.type }
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
const openLayout = (row?: Navigation) => {
|
const openLayout = (row?: Navigation) => {
|
||||||
@@ -410,6 +409,7 @@
|
|||||||
|
|
||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
const remove = (row: Navigation) => {
|
const remove = (row: Navigation) => {
|
||||||
|
console.log(row);
|
||||||
if (row.children?.length) {
|
if (row.children?.length) {
|
||||||
message.error('请先删除子节点');
|
message.error('请先删除子节点');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
v-model:value="form.websiteName"
|
v-model:value="form.websiteName"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="二级域名" name="websiteCode">
|
<a-form-item label="赠送域名" name="websiteCode">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="form.websiteCode"
|
v-model:value="form.websiteCode"
|
||||||
placeholder="huawei"
|
placeholder="huawei"
|
||||||
@@ -43,13 +43,13 @@
|
|||||||
addon-after=".wsdns.cn"
|
addon-after=".wsdns.cn"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- <a-form-item label="顶级域名" name="domain" v-if="form.websiteCode">-->
|
<a-form-item label="自定义域名" name="domain">
|
||||||
<!-- <a-input-->
|
<a-input
|
||||||
<!-- v-model:value="form.domain"-->
|
v-model:value="form.domain"
|
||||||
<!-- placeholder="huawei.com"-->
|
placeholder="huawei.com"
|
||||||
<!-- addon-before="https://"-->
|
addon-before="https://"
|
||||||
<!-- />-->
|
/>
|
||||||
<!-- </a-form-item>-->
|
</a-form-item>
|
||||||
<a-form-item label="网站描述" name="comments">
|
<a-form-item label="网站描述" name="comments">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
:rows="4"
|
:rows="4"
|
||||||
@@ -143,8 +143,8 @@
|
|||||||
import { Website } from '@/api/cms/website/model';
|
import { Website } from '@/api/cms/website/model';
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { FormInstance, type Rule } from 'ant-design-vue/es/form';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
|
||||||
import { FileRecord } from '@/api/system/file/model';
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
import { checkExistence } from '@/api/cms/domain';
|
import { checkExistence } from '@/api/cms/domain';
|
||||||
|
|
||||||
@@ -199,21 +199,6 @@
|
|||||||
statusText: undefined
|
statusText: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
const websiteType = ref<SelectProps['options']>([
|
|
||||||
{
|
|
||||||
value: '企业官网',
|
|
||||||
label: '企业官网'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: '门户网站',
|
|
||||||
label: '门户网站'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: '电子商城',
|
|
||||||
label: '电子商城'
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
/* 更新visible */
|
/* 更新visible */
|
||||||
const updateVisible = (value: boolean) => {
|
const updateVisible = (value: boolean) => {
|
||||||
emit('update:visible', value);
|
emit('update:visible', value);
|
||||||
@@ -334,7 +319,8 @@
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const formData = {
|
const formData = {
|
||||||
...form
|
...form,
|
||||||
|
tenantId: localStorage.getItem('TenantId')
|
||||||
};
|
};
|
||||||
const saveOrUpdate = isUpdate.value ? updateWebsite : addWebsite;
|
const saveOrUpdate = isUpdate.value ? updateWebsite : addWebsite;
|
||||||
saveOrUpdate(formData)
|
saveOrUpdate(formData)
|
||||||
@@ -342,7 +328,11 @@
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
updateVisible(false);
|
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');
|
emit('done');
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|||||||
@@ -29,7 +29,15 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'domain'">
|
<template v-if="column.key === 'domain'">
|
||||||
<a-button
|
<a-button
|
||||||
|
v-if="record.domain"
|
||||||
type="link"
|
type="link"
|
||||||
|
@click="openSpmUrl(`${record.domain}`, record)"
|
||||||
|
>
|
||||||
|
{{ record.domain }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="link"
|
||||||
|
v-if="!record.domain"
|
||||||
@click="
|
@click="
|
||||||
openSpmUrl(
|
openSpmUrl(
|
||||||
`https://${record.websiteCode}.wsdns.cn`,
|
`https://${record.websiteCode}.wsdns.cn`,
|
||||||
|
|||||||
Reference in New Issue
Block a user