diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 5f5eddddc..655fea471 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -3,8 +3,8 @@ class HackUserLastestCodesController < ApplicationController before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :sync_code, :listen_result, :result, :submit_records, :restore_initial_code] before_action :update_user_hack_status, only: [:code_debug, :code_submit] - before_action :require_auth_identity, only: [:update_code, :restore_initial_code, :sync_code] - before_action :require_manager_identity, only: [:update_code] + #before_action :require_auth_identity, only: [:restore_initial_code, :sync_code] + before_action :require_manager_identity, only: [:show, :update_code, :restore_initial_code, :sync_code] def show @my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1 diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 6afe05663..9ef0412ed 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord #validates :input, presence: { message: "测试集输入不能为空" } - validates :output, presence: { message: "测试集输出不能为空" } + #validates :output, presence: { message: "测试集输出不能为空" } validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack diff --git a/public/react/src/common/components/comment/CommentForm.js b/public/react/src/common/components/comment/CommentForm.js index 7683e2dea..cc4e4efd9 100644 --- a/public/react/src/common/components/comment/CommentForm.js +++ b/public/react/src/common/components/comment/CommentForm.js @@ -4,14 +4,14 @@ * @Github: * @Date: 2019-12-17 17:32:55 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-24 17:27:41 + * @LastEditTime : 2019-12-26 11:11:57 */ import './index.scss'; import React, { useState } from 'react'; import { Form, Button, Input } from 'antd'; import QuillForEditor from '../../quillForEditor'; // import { QuillDeltaToHtmlConverter } from 'quill-delta-to-html' -import {formatDelta} from './util'; +// import {formatDelta} from './util'; const FormItem = Form.Item; function CommentForm (props) { @@ -68,8 +68,9 @@ function CommentForm (props) { const content = ctx; props.form.setFieldsValue({'comment': ''}); setCtx(''); - const _html = formatDelta(content.ops); - onSubmit && onSubmit(_html); + // const _html = formatDelta(content.ops); + console.log('保存的内容=====》》》》', content); + onSubmit && onSubmit(JSON.stringify(content)); } }); } diff --git a/public/react/src/common/components/comment/CommentItem.js b/public/react/src/common/components/comment/CommentItem.js index 7360ddfd6..6332dbd9a 100644 --- a/public/react/src/common/components/comment/CommentItem.js +++ b/public/react/src/common/components/comment/CommentItem.js @@ -4,14 +4,19 @@ * @Github: * @Date: 2019-12-17 17:35:17 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-25 14:53:41 + * @LastEditTime : 2019-12-26 11:30:32 */ import './index.scss'; +import 'quill/dist/quill.core.css'; // 核心样式 +import 'quill/dist/quill.snow.css'; // 有工具栏 +import 'quill/dist/quill.bubble.css'; // 无工具栏 +import 'katex/dist/katex.min.css'; // katex 表达式样式 import React, { useState } from 'react'; import CommentIcon from './CommentIcon'; import { getImageUrl, CNotificationHOC } from 'educoder' import { Icon } from 'antd'; import CommentForm from './CommentForm'; +import QuillForEditor from '../../quillForEditor'; function CommentItem ({ isAdmin, @@ -81,9 +86,19 @@ function CommentItem ({ }; // 评论内容 - const commentCtx = (ctx) => ( -
- ); + const commentCtx = (ctx) => { + let _ctx = null; + try { + _ctx = JSON.parse(ctx); + } catch (e) { + _ctx = ctx; + } + return ( ++ {/* 系统繁忙,请稍后重试 */} + {error_msg} +
+ ) + } else if (state === 3) { return (
系统繁忙,请稍后重试
diff --git a/public/react/src/modules/developer/components/initTabCtx/index.scss b/public/react/src/modules/developer/components/initTabCtx/index.scss
index 5427aa374..992d49534 100644
--- a/public/react/src/modules/developer/components/initTabCtx/index.scss
+++ b/public/react/src/modules/developer/components/initTabCtx/index.scss
@@ -41,7 +41,7 @@
}
}
.flex_l{
- padding: 0 10px 0 20px;
+ padding: 0 10px 0 10px;
color: #fff;
}
.flex_r{
diff --git a/public/react/src/modules/developer/components/myMonacoEditor/index.js b/public/react/src/modules/developer/components/myMonacoEditor/index.js
index 261818092..facff0b75 100644
--- a/public/react/src/modules/developer/components/myMonacoEditor/index.js
+++ b/public/react/src/modules/developer/components/myMonacoEditor/index.js
@@ -3,8 +3,8 @@
* @Author: tangjiang
* @Github:
* @Date: 2019-11-27 15:02:52
- * @LastEditors: tangjiang
- * @LastEditTime: 2019-12-20 20:07:11
+ * @LastEditors : tangjiang
+ * @LastEditTime : 2019-12-26 15:19:34
*/
import './index.scss';
import React, { useState, useRef, useEffect } from 'react';
@@ -155,7 +155,7 @@ function MyMonacoEditor (props, ref) {
onClick={handleUpdateNotice}
>
{/*
{ renderNavItem }
-