|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2020-01-15 09:56:34
|
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
|
* @LastEditTime : 2020-01-18 11:40:26
|
|
|
|
|
* @LastEditTime : 2020-01-18 11:51:42
|
|
|
|
|
*/
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import React, {useState, useEffect, useRef} from 'react';
|
|
|
|
@ -12,7 +12,7 @@ import MonacoEditor from '@monaco-editor/react';
|
|
|
|
|
import { Input, Icon } from 'antd';
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
import actions from '../../redux/actions';
|
|
|
|
|
// import cookie from 'react-cookies';
|
|
|
|
|
import cookie from 'react-cookies';
|
|
|
|
|
|
|
|
|
|
const { TextArea } = Input;
|
|
|
|
|
const App = (props) => {
|
|
|
|
@ -44,25 +44,35 @@ const App = (props) => {
|
|
|
|
|
|
|
|
|
|
const {identifier} = props.match.params;
|
|
|
|
|
// 获取路径参数
|
|
|
|
|
|
|
|
|
|
const _params = window.location.search;
|
|
|
|
|
const 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.remove(_arr[0], {
|
|
|
|
|
// path: '/',
|
|
|
|
|
// domain: '.educoder.net'
|
|
|
|
|
// });
|
|
|
|
|
// cookie.save(_arr[0], _arr[1], {
|
|
|
|
|
// path: '/',
|
|
|
|
|
// domain: '.educoder.net'
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
var u = navigator.userAgent;
|
|
|
|
|
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
|
|
|
|
|
if (isIOS) {
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
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], {
|
|
|
|
|
domain: '.educoder.net',
|
|
|
|
|
path: '/',
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
cookie.save(_arr[0], _arr[1], {
|
|
|
|
|
path: '/',
|
|
|
|
|
domain: '.educoder.net'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setCookier();
|
|
|
|
|
const [isActive, setIsActive] = useState(-1);
|
|
|
|
|
const [tip, setTip] = useState('');
|
|
|
|
@ -180,7 +190,7 @@ const App = (props) => {
|
|
|
|
|
const tclasses = _val ? 'result-txt success' : 'result-txt fail';
|
|
|
|
|
const ulClasses = !!last_compile_output ? 'case-list hasResult' : 'case-list';
|
|
|
|
|
const resultFlag = !!last_compile_output ? 'wxcode-test-result active' : 'wxcode-test-result';
|
|
|
|
|
console.log('==========>>>>>>>> 评测结果样式', last_compile_output, resultFlag);
|
|
|
|
|
// console.log('==========>>>>>>>> 评测结果样式', last_compile_output, resultFlag);
|
|
|
|
|
return (
|
|
|
|
|
<div className="wx-code-area">
|
|
|
|
|
<div className="wx-code-flex">
|
|
|
|
|