修复一些小错误

This commit is contained in:
masnn committed 2020-05-13 13:02:49 +08:00
1 parent 8cd84f29e8
commit a596231a06
15 files changed
+125 -124

No files matched your search

+1 -2
View File
@@ -5,9 +5,8 @@ import * as recordEnum from 'vj/constant/record';
const page = new NamedPage('judge_playground', async () => {
const { default: SockJs } = await import('sockjs-client');
const sock = new SockJs('/judge/consume-conn');
const sock = new SockJs(`/judge/consume-conn?token=${ UIContext.csrfToken }`);
sock.onopen = () => {
sock.send(document.cookie);
const div = $('<div class="section visible">').appendTo('#messages');
$('<div class="section__header"><h1 class="section__title">Connection opened.</h1></div>')
.appendTo(div);
-3
View File
@@ -168,9 +168,6 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
} = await loadReactRedux(ScratchpadReducer);
const sock = new SockJs(Context.socketUrl);
sock.onopen = () => {
sock.send(document.cookie);
};
sock.onmessage = (message) => {
const msg = JSON.parse(message.data);
store.dispatch({
-3
View File
@@ -6,9 +6,6 @@ const page = new NamedPage('record_detail', async () => {
const sock = new SockJs(Context.socketUrl);
const dd = new DiffDOM();
sock.onopen = () => {
sock.send(document.cookie);
};
sock.onmessage = (message) => {
const msg = JSON.parse(message.data);
const newStatus = $(msg.status_html);
+1 -4
View File
@@ -9,10 +9,7 @@ const page = new NamedPage('record_main', async () => {
const dd = new DiffDOM();
sock.onopen = () => {
sock.send(document.cookie);
setTimeout(() => {
sock.send(JSON.stringify({ rids: Context.rids }));
}, 300);
sock.send(JSON.stringify({ rids: Context.rids }));
};
sock.onmessage = (message) => {
const msg = JSON.parse(message.data);