dev_tj
杨树林 5 years ago
parent 06beb532f4
commit 230c4c51d8

@ -44,23 +44,33 @@ const App = (props) => {
const {identifier} = props.match.params;
// 获取路径参数
const _params = window.location.search;
const setCookier = () => {
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
if(isAndroid){
const _params = window.location.search;
if (_params) {
let _cookie = '';
let _search = _params.split('?')[1];
if(_search.split('=')) {
_cookie = _search.split('=')[1];
cookie.save('_educoder_session', _cookie);
}
console.log(_cookie);
_search.split('&').forEach(item => {
console.log(item);
const _arr = item.split('=');
cookie.save(_arr[0], _arr[1], { domain: '.educoder.net', path: '/'});
cookie.save(_arr[0], _arr[1], {
path: '/',
domain: '.educoder.net'
});
});
}
}else{
}
}
setCookier();
const [isActive, setIsActive] = useState(-1);
const [tip, setTip] = useState('');

@ -11,21 +11,21 @@ import cookie from 'react-cookies'
// axios.defaults.withCredentials = true;
const setCookier = () => {
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
if(isAndroid){
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], { domain: '.educoder.net', path: '/'});
});
}
}else{
}
//
// var u = navigator.userAgent;
// var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
// if(isAndroid){
// 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], { domain: '.educoder.net', path: '/'});
// });
// }
// }else{
//
// }
}

Loading…
Cancel
Save