This commit is contained in:
黄心宇 2024-05-11 10:47:59 +08:00
parent 743271fa19
commit e058321490
3 changed files with 16 additions and 3 deletions

View File

@ -29,7 +29,7 @@ const options = (target) => {
};
}
let proxy = createProxyMiddleware(options(`http://localhost:${ rubyPort }`));
let proxy
if (process.env.NODE_ENV === 'dev') {
// 本地调试用设置代理
@ -42,6 +42,7 @@ if (process.env.NODE_ENV === 'dev') {
proxy(req, res);
});
} else {
proxy = createProxyMiddleware(options(`http://localhost:${ rubyPort }`));
// 设置代理
app.use(['/api', '/admins', '/attachments', '/oauth', '/competitions', '/projects', '/auth'], (req, res) => {
proxy(req, res);

View File

@ -982,10 +982,13 @@ Detail.preFetch = ({ store, match, query }) => {
});
};
export default withRouter(connect(
export default __CLIENT__ ? withRouter(connect(
mapStateToProps,
mapDispatchToProps
)(ImageLayerOfCommentHOC({
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
parentSelector: ".newContainer",
})(Detail)));
})(Detail))) : withRouter(connect(
mapStateToProps,
mapDispatchToProps
)(Detail));

View File

@ -14,6 +14,15 @@ const axiosInstance = axios.create({
withCredentials: true
});
axiosInstance.interceptors.response.use(
response => {
return response;
},
error => {
console.log(error);
}
)
//
export async function getProjectFunc (owner, projectsId) {