forked from Gitlink/forgeplus-react
Merge pull request 'issue页面可能空白问题修复cont.' (#733) from Eeeros/forgeplus-react:gitlink_ssr_head into gitlink_ssr_head
1
This commit is contained in:
commit
0cd6e7a20c
|
|
@ -4,10 +4,10 @@ import { url, zoneUrl } from '../ssrUrl';
|
|||
let baseUrl = `${url}/api`
|
||||
let baseZoneUrl = `${zoneUrl}/api`
|
||||
|
||||
if (__CLIENT__) {
|
||||
if (__CLIENT__ ) {
|
||||
let settings = localStorage.chromesetting && localStorage.chromesetting !== 'undefined' &&JSON.parse(localStorage.chromesetting);
|
||||
baseUrl = `${settings && settings.common.main_site_url}/api`;
|
||||
baseZoneUrl = `${settings && settings.common.zone}/api`;
|
||||
baseUrl = settings ? `${settings && settings.common.main_site_url}/api` : '/api';
|
||||
baseZoneUrl = settings ? `${settings && settings.common.zone}/api` : `${zoneUrl}/api`;
|
||||
}
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
|
|
@ -24,11 +24,6 @@ axiosInstance.interceptors.response.use(
|
|||
)
|
||||
|
||||
const setHead = () => {
|
||||
if (__CLIENT__ && baseUrl === 'undefined/api') {
|
||||
let settings = localStorage.chromesetting && localStorage.chromesetting !== 'undefined' &&JSON.parse(localStorage.chromesetting);
|
||||
baseUrl = `${settings && settings.common.main_site_url}/api`;
|
||||
baseZoneUrl = `${settings && settings.common.zone}/api`;
|
||||
}
|
||||
if (__SERVER__) {
|
||||
axiosInstance.defaults.headers.cookie = domObj.window.document.cookie
|
||||
axiosInstance.defaults.headers.common['isServer'] = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue