|
|
@ -5,6 +5,7 @@ import md5 from 'md5';
|
|
|
|
import { requestProxy } from "./indexEduplus2RequestProxy";
|
|
|
|
import { requestProxy } from "./indexEduplus2RequestProxy";
|
|
|
|
import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString } from 'educoder';
|
|
|
|
import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString } from 'educoder';
|
|
|
|
import { notification } from 'antd';
|
|
|
|
import { notification } from 'antd';
|
|
|
|
|
|
|
|
import cookie from 'react-cookies';
|
|
|
|
import './index.css';
|
|
|
|
import './index.css';
|
|
|
|
const $ = window.$;
|
|
|
|
const $ = window.$;
|
|
|
|
const opens ="79e33abd4b6588941ab7622aed1e67e8";
|
|
|
|
const opens ="79e33abd4b6588941ab7622aed1e67e8";
|
|
|
@ -24,6 +25,18 @@ function locationurl(list){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setCookier(){
|
|
|
|
|
|
|
|
const _params = window.location.search;
|
|
|
|
|
|
|
|
if (_params) {
|
|
|
|
|
|
|
|
let _search = _params.split('?')[1];
|
|
|
|
|
|
|
|
_search.split('&').forEach(item => {
|
|
|
|
|
|
|
|
console.log(item);
|
|
|
|
|
|
|
|
const _arr = item.split('=');
|
|
|
|
|
|
|
|
cookie.save('_educoder_session',_arr[0]);
|
|
|
|
|
|
|
|
cookie.save('autologin_trustie',_arr[1]);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO 开发期多个身份切换
|
|
|
|
// TODO 开发期多个身份切换
|
|
|
|
let debugType =""
|
|
|
|
let debugType =""
|
|
|
@ -96,7 +109,7 @@ export function initAxiosInterceptors(props) {
|
|
|
|
requestMap[keyName] = false;
|
|
|
|
requestMap[keyName] = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//响应前的设置
|
|
|
|
axios.interceptors.request.use(
|
|
|
|
axios.interceptors.request.use(
|
|
|
|
config => {
|
|
|
|
config => {
|
|
|
|
// config.headers['Content-Type']= 'no-cache'
|
|
|
|
// config.headers['Content-Type']= 'no-cache'
|
|
|
@ -111,6 +124,33 @@ export function initAxiosInterceptors(props) {
|
|
|
|
// proxy = 'http://localhost:3000'
|
|
|
|
// proxy = 'http://localhost:3000'
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// ---------------------------------------------
|
|
|
|
// ---------------------------------------------
|
|
|
|
|
|
|
|
// console.log("开始请求了");
|
|
|
|
|
|
|
|
// console.log(config.url);
|
|
|
|
|
|
|
|
// console.log(window.location.pathname);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const str =window.location.pathname;
|
|
|
|
|
|
|
|
if(str.indexOf("/wxcode") !== -1){
|
|
|
|
|
|
|
|
// console.log("开始重写cookis");
|
|
|
|
|
|
|
|
const _params = window.location.search;
|
|
|
|
|
|
|
|
// console.log("1111");
|
|
|
|
|
|
|
|
if (_params) {
|
|
|
|
|
|
|
|
// console.log("22222");
|
|
|
|
|
|
|
|
let _search = _params.split('?')[1];
|
|
|
|
|
|
|
|
_search.split('&').forEach(item => {
|
|
|
|
|
|
|
|
const _arr = item.split('=');
|
|
|
|
|
|
|
|
if(_arr[0]==='_educoder_session'){
|
|
|
|
|
|
|
|
cookie.save('_educoder_session',_arr[1],{ path: '/' });
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
cookie.save('autologin_trustie',_arr[1],{ path: '/' });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
if (config.url.indexOf(proxy) != -1 || config.url.indexOf(':') != -1) {
|
|
|
|
if (config.url.indexOf(proxy) != -1 || config.url.indexOf(':') != -1) {
|
|
|
|
return config
|
|
|
|
return config
|
|
|
|
}
|
|
|
|
}
|
|
|
|