diff --git a/app/.vitepress/config.ts b/app/.vitepress/config.ts index ec0438390ed9f0a180fb4ac5a9d7e82a01487c5e..5784196d3a69418028b4ff6a38407d6b997e584a 100644 --- a/app/.vitepress/config.ts +++ b/app/.vitepress/config.ts @@ -122,6 +122,7 @@ const config: UserConfig = { }); }, }, + cleanUrls: true, themeConfig: { // locales: { // '/': i18n.zh, diff --git a/app/.vitepress/src/components/AppHeader.vue b/app/.vitepress/src/components/AppHeader.vue index 9cbc81b1857e729c89224ff793863cdf0f0e897b..236af54811fe7260cc4987a55f66f56a07d23ced 100644 --- a/app/.vitepress/src/components/AppHeader.vue +++ b/app/.vitepress/src/components/AppHeader.vue @@ -114,8 +114,14 @@ watch( ); const toBody = ref(false); +// ---------------- 防止logo 刷新闪烁 ------------------- +const logoVisible = ref(false); onMounted(() => { toBody.value = true; + // 设置0.5秒后显示元素 + setTimeout(() => { + logoVisible.value = true; + }, 500); }); onUnmounted(() => { toBody.value = false; @@ -240,6 +246,7 @@ const navItemClick = () => { } } .logo { + visibility: hidden; height: 32px; cursor: pointer; margin-right: var(--e-spacing-h4); diff --git a/app/.vitepress/src/views/sig/sig-detail/SigMeeting.vue b/app/.vitepress/src/views/sig/sig-detail/SigMeeting.vue index f1243172a80ec99fa17a56ef39efbb6ddcba61c6..a3d30e326856618c6a2e87b95de643154f6ee407 100644 --- a/app/.vitepress/src/views/sig/sig-detail/SigMeeting.vue +++ b/app/.vitepress/src/views/sig/sig-detail/SigMeeting.vue @@ -36,9 +36,10 @@ const props = defineProps({ }, mail: { type: String, - default: '', + default: 'dev@openeuler.org', }, }); + const commonStore = useCommon(); let currentMeet = reactive({ date: '', diff --git a/app/.vitepress/src/views/sig/sig-detail/TheSigDetail.vue b/app/.vitepress/src/views/sig/sig-detail/TheSigDetail.vue index 537ece534766c1c76db1e2046dcb61400b4609ce..160dfbe10e383e0f5a70ed5b4ac45b824ba86a43 100644 --- a/app/.vitepress/src/views/sig/sig-detail/TheSigDetail.vue +++ b/app/.vitepress/src/views/sig/sig-detail/TheSigDetail.vue @@ -26,7 +26,7 @@ import { } from '@/api/api-sig'; const router = useRouter(); -const { lang } = useData(); +const { lang, params } = useData(); const i18n = useI18n(); const screenWidth = useWindowResize(); const isIphone = computed(() => { @@ -37,7 +37,10 @@ const paginLayout = computed(() => ? 'prev, slot, jumper, next' : 'sizes, prev, pager, next, slot, jumper' ); -const sigDetailName = ref(''); + +const sigName = computed(() => { + return params.value?.sig || ''; +}); const sigDetail = computed(() => { return i18n.value.sig.SIG_DETAIL; }); @@ -45,13 +48,13 @@ const mail = ref(''); const sigMeetingData: any = ref(''); const sigMemberData: any = ref(''); const memberList: any = ref([]); -const params = reactive({ +const pageParams = reactive({ size: 50, page: 1, }); function getSigDetails() { - getSigDetail(sigDetailName.value, params) + getSigDetail(sigName.value, pageParams) .then((res: any) => { sigMeetingData.value = res.data; }) @@ -63,7 +66,7 @@ function getSigDetails() { function getSigMembers() { const param = { community: 'openeuler', - sig: sigDetailName.value, + sig: sigName.value, }; getSigMember(param).then((res: any) => { if (res?.data[0]) { @@ -123,7 +126,7 @@ const repositoryList = computed(() => { const getRepositoryList = () => { const param = { community: 'openeuler', - sig: sigDetailName.value, + sig: sigName.value, }; getSigRepositoryList(param).then((data) => { if (data.code === 200) { @@ -150,23 +153,6 @@ function setDefaultImage(e: any) { } } onMounted(() => { - function getUrlParam(paraName: any) { - const searchArray = location.search.split('?'); - if (searchArray.length > 1) { - const arrPara = searchArray[1].split('&'); - let arr; - for (let i = 0; i < arrPara.length; i++) { - arr = arrPara[i].split('='); - if (arr !== null && arr[0] === paraName) { - return arr[1]; - } - } - return ''; - } else { - return ''; - } - } - sigDetailName.value = getUrlParam('name'); getSigDetails(); getSigMembers(); getRepositoryList(); @@ -207,22 +193,22 @@ onUpdated(() => { } }); // 获取easyeditor编辑发布的信息 -const href = `https://www.openeuler.org/${lang.value}/sig/sig-detail/?name=`; +const href = `https://www.openeuler.org/${lang.value}/sig/sig-detail/?name=${sigName.value}`; const easyeditorInfo: any = ref({}); function getEasyeditorInfo() { - getSigDetailInfo(href + sigDetailName.value) - .then((res) => { - if (res.statusCode === 200 && res.data?.length) { - res.data.forEach((item: EasyeditorInfoDataItemT) => { - easyeditorInfo.value[item.name] = item; - }); - } - }) - .catch((error) => { - throw new Error(error); - }); + getSigDetailInfo(href).then((res) => { + if (res.statusCode === 200 && res.data?.length) { + res.data.forEach((item: EasyeditorInfoDataItemT) => { + easyeditorInfo.value[item.name] = item; + }); + } + }); } onMounted(() => { + const path = window.location.pathname; + if (path.at(-1) !== '/') { + history.replaceState(null, '', window.location.pathname + '/'); + } getEasyeditorInfo(); }); // 转换md语法 diff --git a/app/.vitepress/src/views/sig/sig-list/SigList.vue b/app/.vitepress/src/views/sig/sig-list/SigList.vue index 5fc643a8038fc6d77fd9f37fae96b36cd3eefea9..23e152a73f12b69db16f28ee03bc54d71bc7aba3 100644 --- a/app/.vitepress/src/views/sig/sig-list/SigList.vue +++ b/app/.vitepress/src/views/sig/sig-list/SigList.vue @@ -338,11 +338,10 @@ onMounted(() => {