Merge pull request 'jk内线源码' (#255) from tongChong/forgeplus-react:local_military into dev_military_local

This commit is contained in:
jasder 2021-11-11 10:07:26 +08:00
commit 6611b6d16f
6 changed files with 17 additions and 35 deletions

View File

@ -116,7 +116,7 @@
},
"scripts": {
"start": "node --max_old_space_size=15360 scripts/start.js",
"build": "cross-env NODE_ENV=production node --max_old_space_size=15360 scripts/build.js",
"build": " NODE_ENV=production node --max_old_space_size=15360 scripts/build.js",
"test-build": "NODE_ENV=testBuild node --max_old_space_size=15360 scripts/build.js",
"pre-build": "NODE_ENV=preBuild node --max_old_space_size=15360 scripts/build.js",
"gen_stats": "NODE_ENV=production webpack --profile --config=./config/webpack.config.prod.js --json > stats.json",

View File

@ -57,6 +57,7 @@ export function initAxiosInterceptors(props) {
var
proxy = "http://localhost:3000";
proxy = "https://forge.osredm.com";
// proxy = "http://117.50.100.12:49999";
const requestMap = {};
window.setfalseInRequestMap = function (keyName) {

View File

@ -6,7 +6,7 @@ import { withRouter } from "react-router";
import { SnackbarHOC } from "educoder";
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
import Handbook from './Component/Handbook';
// import Handbook from './Component/Handbook';
import "./css/index.scss";
import Loadable from "react-loadable";
@ -35,7 +35,7 @@ class Index extends Component {
render() {
return (
<div className="newMain clearfix">
<Handbook />
{/* <Handbook /> */}
<Switch {...this.props}>
<Route
path="/projects/:projectsType/new/:OIdentifier"

View File

@ -3,18 +3,9 @@ import axios from 'axios';
import cookie from 'react-cookies';
let actionUrl = '';
if (window.location.href.indexOf('localhost') > -1) {
actionUrl='https://taskapi.osredm.com';
// actionUrl='http://192.168.31.47:8081';
}else if(window.location.href.indexOf('192.168.31.48') > -1){
actionUrl='https://taskapi.osredm.com';
axios.defaults.withCredentials = true;
}else if(window.location.href.indexOf('noticeweb.osredm') > -1){
actionUrl="https://taskapi.osredm.com";
axios.defaults.withCredentials = true;
}else if(window.location.href.indexOf('forge.osredm.com')>-1){
actionUrl="https://task.osredm.com";
let settings=JSON.parse(localStorage.chromesetting);
let actionUrl = settings.api_urls? settings.api_urls.task :'https://task.osredm.com';
if (window.location.href.indexOf('localhost') < 0) {
axios.defaults.withCredentials = true;
}
export const httpUrl = actionUrl;

View File

@ -1,26 +1,18 @@
import { notification,message } from 'antd';
import { notification } from 'antd';
import axios from 'axios';
import cookie from 'react-cookies';
let actionUrl = '';
if (window.location.href.indexOf('localhost') > -1) {
actionUrl='https://taskapi.osredm.com';
// actionUrl='http://192.168.31.47:8081';
}else if(window.location.href.indexOf('192.168.31.48') > -1){
actionUrl='https://taskapi.osredm.com';
axios.defaults.withCredentials = true;
}else if(window.location.href.indexOf('noticeweb.osredm') > -1){
actionUrl="https://taskapi.osredm.com";
axios.defaults.withCredentials = true;
}else if(window.location.href.indexOf('forge.osredm.com')>-1){
actionUrl="https://info.osredm.com";
let settings = JSON.parse(localStorage.chromesetting);
let actionUrl = settings.api_urls ? settings.api_urls.notice : 'https://info.osredm.com';
if (window.location.href.indexOf('localhost')< 0) {
axios.defaults.withCredentials = true;
}
export const httpUrl = actionUrl;
const TokenKey = 'autologin_forge_military';
// 创建axios实例
const service = axios.create({
baseURL: httpUrl,
@ -91,7 +83,7 @@ service.interceptors.response.use(
},
error => {
console.log(error);
let res = error.response||{};
let res = error.response || {};
if (res.status === 400) {
notification.open({
message: "提示",
@ -111,10 +103,10 @@ service.interceptors.response.use(
message: "提示",
description: res.data.message || '无权限!',
});
window.location.href="/403";
window.location.href = "/403";
return Promise.reject('error');
}
return Promise.reject(error);
}
);

View File

@ -198,7 +198,7 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
showNotification("任务保存成功!");
if (!status) {
history.push("/task/myTask?published=false")
} else if (publishMode == '1') {
} else {
info({
title: '提示',
content: <div>
@ -209,9 +209,7 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
history.push("/task/myTask?published=false");
},
});
} else {
history.push("/task/myTask");
}
}
} else {
showNotification(res.message);
}