文件显示/编辑内容不同

This commit is contained in:
caishi 2023-06-25 14:45:05 +08:00
parent 377ebf2c53
commit b90f26d038
3 changed files with 5 additions and 3 deletions

View File

@ -25,7 +25,7 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -395,6 +395,7 @@ class CoderRootFileDetail extends Component {
filepath={`/${detail.path}`}
content={detail.content}
readOnly={readOnly}
md={md}
editorType="update"
currentBranch={currentBranch}
descName={detail && `Update ${detail.name}`}

View File

@ -6,6 +6,7 @@ import 'codemirror/mode/clike/clike';
import 'codemirror/mode/css/css';
import UserSubmitComponent from "./UserSubmitComponent";
import CloudIDE from "./cloudIDE";
import { Base64 } from "js-base64";
import "./index.css";
import "./editor.css";
@ -34,7 +35,7 @@ class m_editor extends Component {
render() {
const { editorValue, changeValue } = this.state;
const { readOnly, editorType,onEmpty,filename,empty, currentBranch, descName, checkName, detail, match: { params },filepath,ideTheme } = this.props;
const { readOnly, editorType,onEmpty,filename,empty, currentBranch, descName, checkName, detail, match: { params },filepath, ideTheme , md } = this.props;
const editor_options = {
lineNumbers: "on",
lineWrapping: true, //强制换行
@ -64,7 +65,7 @@ class m_editor extends Component {
{!readOnly ?
<CodeMirror
placeholder="请输入内容"
value={editorValue}
value={md ? editorValue : Base64.decode(editorValue)}
options={editor_options}
onChange={this.changeEditor}
/> :