From 74803c7bc2072e87e965af78b94ae46f5ebf48f0 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 29 Sep 2020 11:21:00 +0800 Subject: [PATCH] editor --- src/AppConfig.js | 16 +++++----------- src/forge/Main/CoderRootFileDetail.js | 5 ----- src/forge/Newfile/m_editor.js | 7 ++++--- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index 644676c7..69d3cc31 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -1,6 +1,6 @@ import axios from 'axios'; import { requestProxy } from "./indexEduplus2RequestProxy"; -import { broadcastChannelOnmessage , isDev, queryString } from 'educoder'; +import { broadcastChannelOnmessage, isDev, queryString } from 'educoder'; import { notification } from 'antd'; import cookie from 'react-cookies'; import './index.css'; @@ -57,9 +57,9 @@ window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() // TODO 避免重复的请求 https://github.com/axios/axios#cancellation - var - // proxy = "http://localhost:3000" - proxy = "https://forgeplus.trustie.net" + var + // proxy = "http://localhost:3000" + proxy = "https://testforgeplus.trustie.net" const requestMap = {}; window.setfalseInRequestMap = function (keyName) { @@ -103,12 +103,10 @@ export function initAxiosInterceptors(props) { }); axios.interceptors.response.use(function (response) { - - // console.log(".............") if (response === undefined) { return } - const config = response.config + const config = response.config; if (response.data.status === -1) { if (window.location.pathname.startsWith('/tasks/')) { props.showSnackbar(response.data.message || '服务器异常,请联系管理员。') @@ -121,12 +119,10 @@ export function initAxiosInterceptors(props) { }, }); } - throw new axios.Cancel('Operation canceled by the user.'); } if (response.data.status === 403 || response.data.status === "403") { - locationurl('/403'); } @@ -153,8 +149,6 @@ export function initAxiosInterceptors(props) { message501 = false }, 2000); } - - requestMap[response.config.url] = false; setpostcookie(); return response; diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index f0c9d06a..7b4081d9 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -107,13 +107,8 @@ class CoderRootFileDetail extends Component { EditFile = (flag) => { const { onEdit } = this.props; onEdit && onEdit(flag); - // this.setState({ - // readOnly: false, - // }); }; - // 编辑文件 - changeMmirror = (e, e1, value) => { this.setState({ value, diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js index 806154b0..a2b4216c 100644 --- a/src/forge/Newfile/m_editor.js +++ b/src/forge/Newfile/m_editor.js @@ -1,6 +1,5 @@ import React, { Component } from "react"; import Editor from "react-monaco-editor"; - import UserSubmitComponent from "./UserSubmitComponent"; import "./index.css"; @@ -29,6 +28,7 @@ class m_editor extends Component { lineHeight: 24, renderLineHighlight: "line", revealHorizontalRightPadding: 5, + placeholder:"请输入内容", readOnly: readOnly, cursorStyle: readOnly ? "underline-thin" : "line", folding: true, @@ -46,16 +46,17 @@ class m_editor extends Component {