|
|
|
@ -38,14 +38,6 @@ function setCookier(){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setCookie(key, value) {
|
|
|
|
|
const d = new Date();
|
|
|
|
|
d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000));
|
|
|
|
|
const expires = "expires=" + d.toGMTString();
|
|
|
|
|
document.cookie = `_educoder_session=${key}; domain=.educoder.net; path=/; expires=${expires}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO 开发期多个身份切换
|
|
|
|
|
let debugType =""
|
|
|
|
|
if (isDev) {
|
|
|
|
@ -109,26 +101,27 @@ export function initAxiosInterceptors(props) {
|
|
|
|
|
// proxy="https://test-jupyterweb.educoder.net"
|
|
|
|
|
//proxy="http://192.168.2.63:3001"
|
|
|
|
|
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: '/' });
|
|
|
|
|
cookie.save('_educoder_session',_arr[1], { domain: '.educoder.net', path: '/'});
|
|
|
|
|
}else{
|
|
|
|
|
cookie.save('autologin_trustie',_arr[1],{ path: '/' });
|
|
|
|
|
cookie.save('autologin_trustie',_arr[1], { domain: '.educoder.net', path: '/'});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
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: '/' });
|
|
|
|
|
cookie.save('_educoder_session',_arr[1], { domain: '.educoder.net', path: '/'});
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
cookie.save('autologin_trustie',_arr[1],{ path: '/' });
|
|
|
|
|
cookie.save('autologin_trustie',_arr[1], { domain: '.educoder.net', path: '/'});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|