forked from Gitlink/forgeplus-react
Merge pull request '转发不修改host' (#723) from Eeeros/forgeplus-react:gitlink_ssr_head into gitlink_ssr_head
1
This commit is contained in:
commit
19a8af3817
|
|
@ -15,7 +15,7 @@ app.use('/build', express.static('build'));
|
|||
const options = (target) => {
|
||||
return {
|
||||
target: target,
|
||||
changeOrigin: true, // 允许在请求头中更改主机
|
||||
changeOrigin: false, // 不允许在请求头中更改主机
|
||||
timeout: 30000,
|
||||
onProxyRes: (proxyRes, req, res) => {
|
||||
// 代理成功后输出日志
|
||||
|
|
@ -38,13 +38,13 @@ if (process.env.NODE_ENV === 'dev') {
|
|||
const proxy = createProxyMiddleware(options(zoneUrl));
|
||||
proxy(req, res);
|
||||
});
|
||||
app.use(['/api', '/images', '/system', '/favicon', '/robots.txt', '/sitemap*.xml', '/sitemap*.txt', '/favicon.ico', '/admins', '/assets', '/attachments', '/oauth'], (req, res) => {
|
||||
app.use(['/api', '/images', '/system', '/favicon', '/robots.txt', '/sitemap*.xml', '/sitemap*.txt', '/favicon.ico', '/admins', '/assets', '/attachments', '/oauth', '/settings'], (req, res) => {
|
||||
proxy(req, res);
|
||||
});
|
||||
} else {
|
||||
proxy = createProxyMiddleware(options(`http://localhost:${ rubyPort }`));
|
||||
// 设置代理
|
||||
app.use(['/api', '/admins', '/attachments', '/oauth', '/competitions', '/projects', '/auth'], (req, res) => {
|
||||
app.use(['/api', '/admins', '/attachments', '/oauth', '/competitions', '/projects', '/auth', '/settings'], (req, res) => {
|
||||
proxy(req, res);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,14 +61,14 @@ export function TPMIndexHOC(WrappedComponent) {
|
|||
window.removeEventListener('keyup', this.keyupListener)
|
||||
}
|
||||
componentWillMount() {
|
||||
this.setState({
|
||||
current_user: {}
|
||||
})
|
||||
if (['/:OIdentifier', '/:username'].includes(this.props.match.path)) {
|
||||
this.setState({
|
||||
current_user: {}
|
||||
})
|
||||
}
|
||||
if (!__SERVER__) {
|
||||
this.fetchUsers();
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue