From d23f41319ee565f3078b232c5253000c8ac839c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Mon, 15 Jul 2024 09:04:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/render.js | 6 +++++- src/AppConfig.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/render.js b/server/render.js index 1e778d31b..629264e3f 100644 --- a/server/render.js +++ b/server/render.js @@ -78,8 +78,12 @@ export const render = async (req,res)=>{ script.setAttribute('id', 'initState') } script.textContent = `window.__initState__ = ${ JSON.stringify(store.getState()) }` - + const styleNode = domObj.window.document.createElement('style') + styleNode.type = 'text/css' + // styleNode.innerHTML = `${ [...css].join('') }` + styleNode.innerHTML = detailCss domObj.window.document.head.appendChild(script); + domObj.window.document.head.appendChild(styleNode); } diff --git a/src/AppConfig.js b/src/AppConfig.js index 6a9bb011d..a2f89da29 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -96,7 +96,7 @@ export function initAxiosInterceptors(props) { if (response.data.status === 404) { let responseURL = (response && response.request) ? response.request.responseURL:''; // 组织和个人的拥有情况,404不跳转 - if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1 ) { + if (responseURL && responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1 ) { // 邀请页面不进行404跳转 if( window.location.pathname.includes('/invite') && (responseURL.includes('/simple.json')||responseURL.includes('/detail.json')||responseURL.includes('/menu_list.json'))){ }else{