dev_tj
杨树林 5 years ago
parent 422c2acb7e
commit 97812d590e

@ -109,10 +109,6 @@ export function initAxiosInterceptors(props) {
// proxy="https://test-jupyterweb.educoder.net" // proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001" //proxy="http://192.168.2.63:3001"
try { try {
var u = navigator.userAgent;
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isIOS) {
//苹果走
const str =window.location.pathname; const str =window.location.pathname;
if(str.indexOf("/wxcode") !== -1){ if(str.indexOf("/wxcode") !== -1){
// console.log("开始重写cookis"); // console.log("开始重写cookis");
@ -133,22 +129,6 @@ export function initAxiosInterceptors(props) {
}); });
} }
} }
}else{
// const str =window.location.pathname;
// if(str.indexOf("/wxcode") !== -1){
// const _params = window.location.search;
// if (_params) {
// let _search = _params.split('?')[1];
// _search.split('&').forEach(item => {
// const _arr = item.split('=');
// cookie.save(_arr[0], _arr[1], {
// path: '/',
// domain: '.educoder.net'
// });
// });
// }
// }
}
}catch (e) { }catch (e) {
} }

@ -46,31 +46,26 @@ const App = (props) => {
// 获取路径参数 // 获取路径参数
const _params = window.location.search; const _params = window.location.search;
const setCookier = () => { const setCookier = () => {
var u = navigator.userAgent; // var u = navigator.userAgent;
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 // var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isIOS) { // if (isIOS) {
// }else{
}else{ // if (_params) {
const _params = window.location.search; // let _cookie = '';
if (_params) { // let _search = _params.split('?')[1];
let _search = _params.split('?')[1]; // if(_search.split('=')) {
_search.split('&').forEach(item => { // _cookie = _search.split('=')[1];
// console.log(item); // cookie.save('_educoder_session', _cookie);
const _arr = item.split('='); // }
cookie.remove(_arr[0], { // _search.split('&').forEach(item => {
domain: '.educoder.net', // const _arr = item.split('=');
path: '/', // cookie.save(_arr[0], _arr[1], {
// path: '/',
}); // domain: '.educoder.net'
cookie.save(_arr[0], _arr[1], { // });
path: '/', // });
domain: '.educoder.net' // }
}); // }
});
}
}
} }
setCookier(); setCookier();

@ -11,30 +11,30 @@ import cookie from 'react-cookies'
// axios.defaults.withCredentials = true; // axios.defaults.withCredentials = true;
const setCookier = () => { const setCookier = () => {
var u = navigator.userAgent; // var u = navigator.userAgent;
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 // var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isIOS) { // if (isIOS) {
//
}else{ // }else{
const _params = window.location.search; // const _params = window.location.search;
if (_params) { // if (_params) {
let _search = _params.split('?')[1]; // let _search = _params.split('?')[1];
_search.split('&').forEach(item => { // _search.split('&').forEach(item => {
// console.log(item); // // console.log(item);
const _arr = item.split('='); // const _arr = item.split('=');
cookie.remove(_arr[0], { // cookie.remove(_arr[0], {
domain: '.educoder.net', // domain: '.educoder.net',
path: '/', // path: '/',
//
}); // });
cookie.save(_arr[0], _arr[1], { // cookie.save(_arr[0], _arr[1], {
path: '/', // path: '/',
domain: '.educoder.net' // domain: '.educoder.net'
}); // });
}); // });
} // }
//
} // }
} }
// 获取代码块 // 获取代码块

Loading…
Cancel
Save