|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2020-01-15 09:56:34
|
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
|
* @LastEditTime : 2020-01-18 11:51:42
|
|
|
|
|
* @LastEditTime : 2020-01-18 15:07:09
|
|
|
|
|
*/
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import React, {useState, useEffect, useRef} from 'react';
|
|
|
|
@ -44,30 +44,24 @@ const App = (props) => {
|
|
|
|
|
|
|
|
|
|
const {identifier} = props.match.params;
|
|
|
|
|
// 获取路径参数
|
|
|
|
|
const _params = window.location.search;
|
|
|
|
|
const setCookier = () => {
|
|
|
|
|
// var u = navigator.userAgent;
|
|
|
|
|
// var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
|
|
|
|
|
// if (isIOS) {
|
|
|
|
|
// }else{
|
|
|
|
|
// if (_params) {
|
|
|
|
|
// let _cookie = '';
|
|
|
|
|
// let _search = _params.split('?')[1];
|
|
|
|
|
// if(_search.split('=')) {
|
|
|
|
|
// _cookie = _search.split('=')[1];
|
|
|
|
|
// cookie.save('_educoder_session', _cookie);
|
|
|
|
|
// }
|
|
|
|
|
// _search.split('&').forEach(item => {
|
|
|
|
|
// const _arr = item.split('=');
|
|
|
|
|
// cookie.save(_arr[0], _arr[1], {
|
|
|
|
|
// path: '/',
|
|
|
|
|
// domain: '.educoder.net'
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
const _params = window.location.search;
|
|
|
|
|
if (_params) {
|
|
|
|
|
let _search = _params.split('?')[1];
|
|
|
|
|
_search.split('&').forEach(item => {
|
|
|
|
|
// console.log(item);
|
|
|
|
|
const _arr = item.split('=');
|
|
|
|
|
cookie.remove(_arr[0], {
|
|
|
|
|
path: '/',
|
|
|
|
|
domain: '.educoder.net'
|
|
|
|
|
});
|
|
|
|
|
cookie.save(_arr[0], _arr[1], {
|
|
|
|
|
path: '/',
|
|
|
|
|
domain: '.educoder.net'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setCookier();
|
|
|
|
|
const [isActive, setIsActive] = useState(-1);
|
|
|
|
|
const [tip, setTip] = useState('');
|
|
|
|
@ -198,7 +192,7 @@ const App = (props) => {
|
|
|
|
|
options={{
|
|
|
|
|
selectOnLineNumbers: true,
|
|
|
|
|
automaticLayout: true,
|
|
|
|
|
fontSize: `36px`
|
|
|
|
|
fontSize: `42px`
|
|
|
|
|
}}
|
|
|
|
|
theme='dark'
|
|
|
|
|
editorDidMount={handleEditorChange}
|
|
|
|
|