mirror of https://gitee.com/answerdev/answer.git
fix: questionLanding function params is null render error
This commit is contained in:
parent
68aa0f66bb
commit
db53a5b5a2
|
@ -144,7 +144,6 @@ export function htmlRender(el: HTMLElement | null) {
|
||||||
|
|
||||||
// add rel nofollow for link not inlcludes domain
|
// add rel nofollow for link not inlcludes domain
|
||||||
el.querySelectorAll('a').forEach((a) => {
|
el.querySelectorAll('a').forEach((a) => {
|
||||||
if (a?.href?.includes('http')) return;
|
|
||||||
const base = window.location.origin;
|
const base = window.location.origin;
|
||||||
const targetUrl = new URL(a.href, base);
|
const targetUrl = new URL(a.href, base);
|
||||||
if (targetUrl.toString() !== window.location.href) {
|
if (targetUrl.toString() !== window.location.href) {
|
||||||
|
|
|
@ -19,6 +19,9 @@ const tagEdit = (tagId: string) => {
|
||||||
};
|
};
|
||||||
const questionLanding = (questionId: string, slugTitle: string = '') => {
|
const questionLanding = (questionId: string, slugTitle: string = '') => {
|
||||||
const { seo } = seoSettingStore.getState();
|
const { seo } = seoSettingStore.getState();
|
||||||
|
if (!questionId) {
|
||||||
|
return slugTitle ? `/questions/null/slugTitle` : '/questions/null';
|
||||||
|
}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (/[13]/.test(seo.permalink) && slugTitle) {
|
if (/[13]/.test(seo.permalink) && slugTitle) {
|
||||||
return urlcat('/questions/:questionId/:slugPermalink', {
|
return urlcat('/questions/:questionId/:slugPermalink', {
|
||||||
|
|
Loading…
Reference in New Issue