|
|
@ -1,7 +1,7 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* @Description: 微信端代码编辑器
|
|
|
|
* @Description: 微信端代码编辑器
|
|
|
|
* @Author: tangjiang
|
|
|
|
* @Author: tangjiang
|
|
|
|
* @Github:
|
|
|
|
* @Github:
|
|
|
|
* @Date: 2020-01-15 09:56:34
|
|
|
|
* @Date: 2020-01-15 09:56:34
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
* @LastEditTime : 2020-01-17 15:34:40
|
|
|
|
* @LastEditTime : 2020-01-17 15:34:40
|
|
|
@ -35,28 +35,28 @@ const App = (props) => {
|
|
|
|
evaluateWxCode,
|
|
|
|
evaluateWxCode,
|
|
|
|
showWXCodeTextCase,
|
|
|
|
showWXCodeTextCase,
|
|
|
|
changeWXCodeEvaluateLoading
|
|
|
|
changeWXCodeEvaluateLoading
|
|
|
|
} = props;
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
|
|
const {identifier} = props.match.params;
|
|
|
|
const {identifier} = props.match.params;
|
|
|
|
// 获取路径参数
|
|
|
|
// 获取路径参数
|
|
|
|
|
|
|
|
|
|
|
|
const setCookier = () => {
|
|
|
|
const setCookier = () => {
|
|
|
|
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], {
|
|
|
|
path: '/',
|
|
|
|
// path: '/',
|
|
|
|
domain: '.educoder.net'
|
|
|
|
// domain: '.educoder.net'
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
cookie.save(_arr[0], _arr[1], {
|
|
|
|
// cookie.save(_arr[0], _arr[1], {
|
|
|
|
path: '/',
|
|
|
|
// path: '/',
|
|
|
|
domain: '.educoder.net'
|
|
|
|
// domain: '.educoder.net'
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setCookier();
|
|
|
|
setCookier();
|
|
|
|
const [isActive, setIsActive] = useState(-1);
|
|
|
|
const [isActive, setIsActive] = useState(-1);
|
|
|
@ -111,7 +111,7 @@ const App = (props) => {
|
|
|
|
updateWXCodeForInterval(identifier, path);
|
|
|
|
updateWXCodeForInterval(identifier, path);
|
|
|
|
}, 10000);
|
|
|
|
}, 10000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 关闭单个测试集
|
|
|
|
// 关闭单个测试集
|
|
|
|
const handleCloseItem = (i, flag) => {
|
|
|
|
const handleCloseItem = (i, flag) => {
|
|
|
@ -130,7 +130,7 @@ const App = (props) => {
|
|
|
|
changeWXCodeEvaluateLoading(true);
|
|
|
|
changeWXCodeEvaluateLoading(true);
|
|
|
|
evaluateWxCode(identifier, path);
|
|
|
|
evaluateWxCode(identifier, path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const tcclasses = isShow ? `wx-code-test-case active` : 'wx-code-test-case';
|
|
|
|
const tcclasses = isShow ? `wx-code-test-case active` : 'wx-code-test-case';
|
|
|
|
const loading = showLoading ? 'code-evaluate-loading active' : 'code-evaluate-loading';
|
|
|
|
const loading = showLoading ? 'code-evaluate-loading active' : 'code-evaluate-loading';
|
|
|
|
const _val = sets_error_count === 0;
|
|
|
|
const _val = sets_error_count === 0;
|
|
|
@ -200,19 +200,19 @@ const App = (props) => {
|
|
|
|
</h2>
|
|
|
|
</h2>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
is_public
|
|
|
|
is_public
|
|
|
|
? (result
|
|
|
|
? (result
|
|
|
|
? <span className="iconfont icon-wancheng case_item_success"></span>
|
|
|
|
? <span className="iconfont icon-wancheng case_item_success"></span>
|
|
|
|
: <span className="iconfont icon-jinggao1 case_item_fail"></span>)
|
|
|
|
: <span className="iconfont icon-jinggao1 case_item_fail"></span>)
|
|
|
|
: (<span className="case-item-tips">
|
|
|
|
: (<span className="case-item-tips">
|
|
|
|
隐藏测试集,暂不支持解锁和查看
|
|
|
|
隐藏测试集,暂不支持解锁和查看
|
|
|
|
{/* {result
|
|
|
|
{/* {result
|
|
|
|
? <span className="iconfont icon-wancheng case_item_success"></span>
|
|
|
|
? <span className="iconfont icon-wancheng case_item_success"></span>
|
|
|
|
: <span className="iconfont icon-jinggao1 case_item_fail"></span>
|
|
|
|
: <span className="iconfont icon-jinggao1 case_item_fail"></span>
|
|
|
|
} */}
|
|
|
|
} */}
|
|
|
|
</span>)
|
|
|
|
</span>)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={_classes}>
|
|
|
|
<div className={_classes}>
|
|
|
|
<span className="desc-title">测试输入</span>
|
|
|
|
<span className="desc-title">测试输入</span>
|
|
|
|
<span className="test-input">{input || '-'}</span>
|
|
|
|
<span className="test-input">{input || '-'}</span>
|
|
|
|