Merge branch 'dev_aliyun' into dev_tj

merge aliyun
dev_new_shixunsrepository
tangjiang 5 years ago
commit aec7cf9eed

@ -23,21 +23,21 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名 # 所有请求必须合法签名
def check_sign def check_sign
# Rails.logger.info("66666 #{params}") Rails.logger.info("66666 #{params}")
# suffix = request.url.split(".").last suffix = request.url.split(".").last
# suffix_arr = ["xls", "xlsx"] # excel文件先注释 suffix_arr = ["xls", "xlsx"] # excel文件先注释
# unless suffix_arr.include?(suffix) unless suffix_arr.include?(suffix)
# if params[:client_key].present? if params[:client_key].present?
# randomcode = params[:randomcode] randomcode = params[:randomcode]
# tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5) tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
#
# sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}") sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
# Rails.logger.info("2222 #{sign}") Rails.logger.info("2222 #{sign}")
# tip_exception(501, "请求不合理") if sign != params[:client_key] tip_exception(501, "请求不合理") if sign != params[:client_key]
# else else
# tip_exception(501, "请求不合理") tip_exception(501, "请求不合理")
# end end
# end end
end end
# 全局配置参数 # 全局配置参数

@ -10,7 +10,6 @@ class Admins::IdentityAuths::AgreeApplyService < ApplicationService
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
apply.update!(status: 1) apply.update!(status: 1)
user.update!(authentication: true) user.update!(authentication: true)
user.update!(is_shixun_marker: true) if user.is_teacher?
RewardGradeService.call(user, container_id: user.id, container_type: 'Authentication', score: 500) RewardGradeService.call(user, container_id: user.id, container_type: 'Authentication', score: 500)
deal_tiding! deal_tiding!

@ -10,7 +10,7 @@ class Admins::ProfessionalAuths::AgreeApplyService < ApplicationService
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
apply.update!(status: 1) apply.update!(status: 1)
user.update!(professional_certification: true) user.update!(professional_certification: true)
user.update!(is_shixun_marker: true) if user.is_teacher?
RewardGradeService.call(user, container_id: user.id, container_type: 'Professional', score: 500) RewardGradeService.call(user, container_id: user.id, container_type: 'Professional', score: 500)
deal_tiding! deal_tiding!

@ -51,7 +51,7 @@ if (isDev) {
checkSubmitFlg=true checkSubmitFlg=true
window.setTimeout(function () { window.setTimeout(function () {
checkSubmitFlg=false; checkSubmitFlg=false;
}, 3500); }, 2500);
}else if(checkSubmitFlg===false){ }else if(checkSubmitFlg===false){
$.ajax({url:proxy,async:false,success:function(data){ $.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){ if(data.status===0){
@ -61,7 +61,7 @@ if (isDev) {
checkSubmitFlg=true checkSubmitFlg=true
window.setTimeout(function () { window.setTimeout(function () {
checkSubmitFlg=false; checkSubmitFlg=false;
}, 3500); }, 2500);
} }
} }
window._debugType = debugType; window._debugType = debugType;

@ -1,3 +1,5 @@
import md5 from 'md5';
const $ = window.$;
const isDev = window.location.port == 3007; const isDev = window.location.port == 3007;
export const TEST_HOST = "https://test-newweb.educoder.net" export const TEST_HOST = "https://test-newweb.educoder.net"
export function getImageUrl(path) { export function getImageUrl(path) {
@ -68,19 +70,46 @@ export function getUrl2(path, goTest) {
} }
return `${path ? path: ''}`; return `${path ? path: ''}`;
} }
const newopens ="79e33abd4b6588941ab7622aed1e67e8";
let newtimestamp;
let checkSubmitFlgs = false;
function railsgettimess(proxy) {
if(checkSubmitFlgs===false){
$.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){
newtimestamp=data.message;
}
}})
checkSubmitFlgs=true
window.setTimeout(function () {
checkSubmitFlgs=false;
}, 2500);
}
}
export function Railsgettimes() {
railsgettimess(`${getUrl()}/api/main/first_stamp.json`);
}
export function getUploadActionUrl(path, goTest) { export function getUploadActionUrl(path, goTest) {
return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}` Railsgettimes()
let anewopens=md5(newopens+newtimestamp);
return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`;
} }
export function getUploadActionUrltwo(id) { export function getUploadActionUrltwo(id) {
Railsgettimes()
return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}` let anewopens=md5(newopens+newtimestamp);
return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`
} }
export function getUploadActionUrlthree() { export function getUploadActionUrlthree() {
Railsgettimes()
return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}` let anewopens=md5(newopens+newtimestamp);
return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`
} }
export function getUploadActionUrlOfAuth(id) { export function getUploadActionUrlOfAuth(id) {
return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}` Railsgettimes()
let anewopens=md5(newopens+newtimestamp);
return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`
} }
export function test(path) { export function test(path) {
@ -96,6 +125,11 @@ export function getTaskUrlById(id) {
return `/tasks/${id}` return `/tasks/${id}`
} }
export function getRandomcode(url) {
Railsgettimes()
let anewopens=md5(newopens+newtimestamp);
return `${url}?&randomcode=${newtimestamp}&client_key=${anewopens}`
}
export function htmlEncode(str) { export function htmlEncode(str) {
var s = ""; var s = "";

@ -2,7 +2,7 @@
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil'; // export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl export { getImageUrl as getImageUrl, getUrl as getUrl, getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool'; , getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool';
export { default as queryString } from './UrlTool2'; export { default as queryString } from './UrlTool2';

@ -51,7 +51,7 @@ class GotoQQgroup extends Component {
<div className="tabeltext-alignleft mt10"><p>群号612934990</p></div> <div className="tabeltext-alignleft mt10"><p>群号612934990</p></div>
<div className="clearfix mt30 edu-txt-center"> <div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a> <a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即联系</a> <a className="task-btn task-btn-orange" target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd">立即联系</a>
</div> </div>
</div> </div>
</Modal> </Modal>

@ -6,7 +6,7 @@ import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames' import classNames from 'classnames'
import { getImageUrl, toPath, getUrl,getUploadActionUrl } from 'educoder';
import './CommentItemMDEditor.css' import './CommentItemMDEditor.css'
const $ = window.$; const $ = window.$;
@ -36,7 +36,7 @@ class CommentItemMDEditor extends Component {
if( $(`#${initMD_ID} textarea`).length === 1 ) { // 没有初始化 if( $(`#${initMD_ID} textarea`).length === 1 ) { // 没有初始化
const placeholder = '我要回复...' const placeholder = '我要回复...'
// const imageUrl = `/upload_with_markdown?container_id=${commentId}&container_type=Memo`; // const imageUrl = `/upload_with_markdown?container_id=${commentId}&container_type=Memo`;
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
const otherOptions = { const otherOptions = {
watch: false, watch: false,

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Button, Card, Row, Col ,Upload,Icon,message,Tabs} from 'antd'; import {Button, Card, Row, Col ,Upload,Icon,message,Tabs} from 'antd';
import axios from 'axios'; import axios from 'axios';
import {getImageUrl,getUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder'; import {getUploadActionUrl,getUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
const { TabPane } = Tabs; const { TabPane } = Tabs;
class CompetitionContentsMd extends Component{ class CompetitionContentsMd extends Component{
@ -184,7 +184,7 @@ class CompetitionContentsMd extends Component{
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleContentUploadChange, onChange: this.handleContentUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'), onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'),
beforeUpload: (file) => { beforeUpload: (file) => {

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Button,Layout,Row, Col,Divider,Table} from 'antd'; import {Button,Layout,Row, Col,Divider,Table} from 'antd';
import axios from 'axios'; import axios from 'axios';
import {getImageUrl} from 'educoder'; import {getImageUrl,getRandomcode} from 'educoder';
import './CompetitionContentspdfdownload.css'; import './CompetitionContentspdfdownload.css';
// import NoneData from "../../../courses/shixunHomework/shixunHomework"; // import NoneData from "../../../courses/shixunHomework/shixunHomework";
@ -158,7 +158,7 @@ class CompetitionContentspdfdownload extends Component{
return( return(
<span className={"mr10"} key={key}> <span className={"mr10"} key={key}>
<img src={ getImageUrl(`images/educoder/pdfs.png`)} /> <img src={ getImageUrl(`images/educoder/pdfs.png`)} />
<a className={"pdfdownloadfont4CACFF ml10"} href={item.url} download="" <a className={"pdfdownloadfont4CACFF ml10"} href={getRandomcode(item.url)} download=""
title="下载" mce_href="#">立即下载</a> title="下载" mce_href="#">立即下载</a>
</span> </span>
) )
@ -172,7 +172,7 @@ class CompetitionContentspdfdownload extends Component{
return( return(
<span className={"mr10"} key={key}> <span className={"mr10"} key={key}>
<img src={ getImageUrl(`images/educoder/pdfs.png`)} /> <img src={ getImageUrl(`images/educoder/pdfs.png`)} />
<a className={"pdfdownloadfont4CACFF ml10"} href={item.url} download="" <a className={"pdfdownloadfont4CACFF ml10"} href={getRandomcode(item.url)} download=""
title="下载" mce_href="#">立即下载</a> title="下载" mce_href="#">立即下载</a>
</span> </span>
) )

@ -3,7 +3,7 @@ import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Moda
import axios from 'axios' import axios from 'axios'
import '../css/busyWork.css' import '../css/busyWork.css'
import '../css/Courses.css' import '../css/Courses.css'
import { WordsBtn, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder' import {getUploadActionUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder'
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
@ -333,7 +333,7 @@ class NewWorkForm extends Component{
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleContentUploadChange, onChange: this.handleContentUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'), onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'),
beforeUpload: (file) => { beforeUpload: (file) => {
@ -352,7 +352,7 @@ class NewWorkForm extends Component{
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleAnswerUploadChange, onChange: this.handleAnswerUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'answerFileList'), onRemove: (file) => this.onAttachmentRemove(file, 'answerFileList'),
beforeUpload: (file) => { beforeUpload: (file) => {

@ -150,8 +150,8 @@ class TabRightComponents extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"padding":"0 20px"}}> {this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={exportResultUrl} onClick={(url)=>this.confirmysl(exportResultUrl)} className="color-dark">导出成绩</a></li> <li><a onClick={(url)=>this.confirmysl(exportResultUrl)} className="color-dark">导出成绩</a></li>
<li><a href={exportUrl} onClick={(url)=>this.confirmysl(exportUrl)} className="color-dark">导出作品附件</a></li> <li><a onClick={(url)=>this.confirmysl(exportUrl)} className="color-dark">导出作品附件</a></li>
</ul> </ul>
</li>:""} </li>:""}

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Button, Card, Row, Col ,Upload,Icon,message,Tabs} from 'antd'; import {Button, Card, Row, Col ,Upload,Icon,message,Tabs} from 'antd';
import axios from 'axios'; import axios from 'axios';
import {getImageUrl,getUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder'; import {getUploadActionUrl,getUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
const { TabPane } = Tabs; const { TabPane } = Tabs;
class CompetitionContentsMd extends Component{ class CompetitionContentsMd extends Component{
@ -184,7 +184,7 @@ class CompetitionContentsMd extends Component{
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleContentUploadChange, onChange: this.handleContentUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'), onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'),
beforeUpload: (file) => { beforeUpload: (file) => {

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Button,Layout,Row, Col,Divider,Table} from 'antd'; import {Button,Layout,Row, Col,Divider,Table} from 'antd';
import axios from 'axios'; import axios from 'axios';
import {getImageUrl} from 'educoder'; import {getImageUrl,getRandomcode} from 'educoder';
import './CompetitionContentspdfdownload.css'; import './CompetitionContentspdfdownload.css';
// import NoneData from "../../../courses/shixunHomework/shixunHomework"; // import NoneData from "../../../courses/shixunHomework/shixunHomework";
@ -158,7 +158,7 @@ class CompetitionContentspdfdownload extends Component{
return( return(
<span className={"mr10"} key={key}> <span className={"mr10"} key={key}>
<img src={ getImageUrl(`images/educoder/pdfs.png`)} /> <img src={ getImageUrl(`images/educoder/pdfs.png`)} />
<a className={"pdfdownloadfont4CACFF ml10"} href={item.url} download="" <a className={"pdfdownloadfont4CACFF ml10"} href={getRandomcode(item.url)} download=""
title="下载" mce_href="#">立即下载</a> title="下载" mce_href="#">立即下载</a>
</span> </span>
) )
@ -172,7 +172,7 @@ class CompetitionContentspdfdownload extends Component{
return( return(
<span className={"mr10"} key={key}> <span className={"mr10"} key={key}>
<img src={ getImageUrl(`images/educoder/pdfs.png`)} /> <img src={ getImageUrl(`images/educoder/pdfs.png`)} />
<a className={"pdfdownloadfont4CACFF ml10"} href={item.url} download="" <a className={"pdfdownloadfont4CACFF ml10"} href={getRandomcode(item.url)} download=""
title="下载" mce_href="#">立即下载</a> title="下载" mce_href="#">立即下载</a>
</span> </span>
) )

@ -6,7 +6,7 @@ import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
import { getImageUrl, toPath, getUrl } from 'educoder'; import { getImageUrl, toPath, getUrl,getUploadActionUrl } from 'educoder';
import axios from 'axios'; import axios from 'axios';
@ -171,7 +171,7 @@ export default class CoursesMarkdown extends Component {
// const placeholder = ""; // const placeholder = "";
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
// 创建editorMd // 创建editorMd
const answers_editormd = create_editorMD(_id, '100%', 400, placeholder, imageUrl, () => { const answers_editormd = create_editorMD(_id, '100%', 400, placeholder, imageUrl, () => {

@ -1,7 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Upload,Button,Icon,message,DatePicker,Tooltip,Radio} from "antd"; import { Modal,Checkbox,Select,Input,Upload,Button,Icon,message,DatePicker,Tooltip,Radio} from "antd";
import axios from'axios'; import axios from'axios';
import {getUrl,handleDateString,appendFileSizeToUploadFileAll} from 'educoder'; import {getUrl,handleDateString,appendFileSizeToUploadFileAll,getUploadActionUrl} from 'educoder';
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment'; import moment from 'moment';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
@ -264,7 +264,7 @@ class Selectsetting extends Component{
const uploadProps = { const uploadProps = {
width: 600, width: 600,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file) => { beforeUpload: (file) => {

@ -2,7 +2,7 @@ import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,DatePicker,Select,Tooltip,Radio} from "antd"; import { Modal,Checkbox,Upload,Button,Icon,message,DatePicker,Select,Tooltip,Radio} from "antd";
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import {getUrl,handleDateString,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder'; import {getUploadActionUrl,handleDateString,appendFileSizeToUploadFileAll} from 'educoder';
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment'; import moment from 'moment';
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
@ -246,7 +246,7 @@ class Sendresource extends Component{
const uploadProps = { const uploadProps = {
width: 600, width: 600,
// showUploadList:false, // showUploadList:false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file) => { beforeUpload: (file) => {

@ -1,7 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu,Spin} from "antd"; import {Checkbox,Input,Table, Pagination,Menu,Spin} from "antd";
import {Link,NavLink} from 'react-router-dom'; import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,queryString,downloadFile} from 'educoder'; import { WordsBtn ,ActionBtn,queryString,getRandomcode} from 'educoder';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import '../css/members.css'; import '../css/members.css';
import '../css/busyWork.css'; import '../css/busyWork.css';
@ -404,7 +404,7 @@ class Testpapersettinghomepage extends Component{
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`,this.child)}>学生成绩</a></li> <li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`,this.child)}>学生成绩</a></li>
{/* <li><a onClick={()=>this.confpdf(`/api/exercises/${this.props.match.params.Id}/export_exercise`)} >空白试卷</a></li> */} {/* <li><a onClick={()=>this.confpdf(`/api/exercises/${this.props.match.params.Id}/export_exercise`)} >空白试卷</a></li> */}
<li><a href={`/api/exercises/${this.props.match.params.Id}/export_exercise`} target="_blank">空白试卷</a></li> <li><a href={getRandomcode(`/api/exercises/${this.props.match.params.Id}/export_exercise`)} target="_blank">空白试卷</a></li>
{/*<li><a onClick={()=>this.confirmysl(`/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval===null||this.state.groupyslsval===undefined?null:this.state.groupyslsval}`)}>学生答题试卷</a></li>*/} {/*<li><a onClick={()=>this.confirmysl(`/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval===null||this.state.groupyslsval===undefined?null:this.state.groupyslsval}`)}>学生答题试卷</a></li>*/}
</ul> </ul>
</li></Spin>:""} </li></Spin>:""}

@ -2,7 +2,7 @@ import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl ,bytesToSize,getImageUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder'; import { WordsBtn,getUploadActionUrl ,bytesToSize,getImageUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
const Search = Input.Search; const Search = Input.Search;
@ -512,7 +512,7 @@ class GraduationTasksSubmitedit extends Component{
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file) => { beforeUpload: (file) => {

@ -3,7 +3,7 @@ import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Tooltip,Spin} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Tooltip,Spin} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl,getImageUrl,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder'; import { WordsBtn,getUrl,getImageUrl,getUploadActionUrl,appendFileSizeToUploadFileAll} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
const Search = Input.Search; const Search = Input.Search;
@ -536,7 +536,7 @@ render(){
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file) => { beforeUpload: (file) => {

@ -2,7 +2,7 @@ import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl ,bytesToSize,appendFileSizeToUploadFileAll,AttachmentList,appendFileSizeToUploadFile} from 'educoder'; import { WordsBtn,getUrl ,getUploadActionUrl,appendFileSizeToUploadFileAll,AttachmentList,appendFileSizeToUploadFile} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
import '../../css/Courses.css'; import '../../css/Courses.css';
@ -314,7 +314,7 @@ class GraduationTasksedit extends Component{
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file) => { beforeUpload: (file) => {

@ -7,7 +7,7 @@ import {
} from 'antd'; } from 'antd';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import axios from 'axios' import axios from 'axios'
import {getUrl} from 'educoder'; import {getUrl,getUploadActionUrl} from 'educoder';
import "../../common/formCommon.css" import "../../common/formCommon.css"
// import './board.css' // import './board.css'
@ -248,7 +248,7 @@ class GraduateTopicPostWorksNew extends Component{
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file) => { beforeUpload: (file) => {

@ -1,6 +1,6 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import {Table, Pagination,Popover,Spin, Row, Col ,Tabs, Icon} from "antd"; import {Table, Pagination,Popover,Spin, Row, Col ,Tabs, Icon} from "antd";
import { WordsBtn,on, off, trigger ,getImageUrl,sortDirections} from 'educoder'; import { WordsBtn,on, off, getRandomcode ,getImageUrl,sortDirections} from 'educoder';
import axios from'axios'; import axios from'axios';
import Dropdownbox from './Dropdownbox'; import Dropdownbox from './Dropdownbox';
import Dynamiclist from './Dynamiclist'; import Dynamiclist from './Dynamiclist';
@ -172,7 +172,7 @@ class Statistics extends Component{
} }
}) })
this.props.slowDownload(`${url}?${urllist}`); this.props.slowDownload(getRandomcode(`${url}?${urllist}`));
} }

@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames' import classNames from 'classnames'
import { isDev } from 'educoder' import { getUploadActionUrl } from 'educoder'
import './MemoDetailEditor.css' import './MemoDetailEditor.css'
@ -36,7 +36,7 @@ class MemoDetailMDEditor extends Component {
// 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可 // 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可
const placeholder = '我要回复...' const placeholder = '我要回复...'
// const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`; // const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`;
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
if (this.isMDInited) { if (this.isMDInited) {
return; return;
} }

@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames' import classNames from 'classnames'
import { isDev } from 'educoder' import { getUploadActionUrl } from 'educoder'
import './MemoDetailEditor.css' import './MemoDetailEditor.css'
@ -35,7 +35,7 @@ class MemoDetailMDEditortwo extends Component {
// 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可 // 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可
const placeholder = '我要回复...' const placeholder = '我要回复...'
// const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`; // const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`;
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
// 执行太快了,样式不正常 // 执行太快了,样式不正常
window.__tt = 400; window.__tt = 400;

@ -441,7 +441,7 @@ class MemoNew extends Component {
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
// const imageUrl = `/upload_with_markdown?container_id=&container_type=Memo`; // const imageUrl = `/upload_with_markdown?container_id=&container_type=Memo`;
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
// 创建editorMd // 创建editorMd

@ -2,6 +2,7 @@ import React,{ Component } from "react";
import {getUrl,markdownToHTML} from 'educoder'; import {getUrl,markdownToHTML} from 'educoder';
import {Input,Button} from 'antd'; import {Input,Button} from 'antd';
import TPMMDEditor from "../tpm/challengesnew/TPMMDEditor";
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import axios from 'axios'; import axios from 'axios';
@ -11,79 +12,11 @@ require('codemirror/lib/codemirror.css');
const $ = window.$; const $ = window.$;
let origin = getUrl();
let path = getUrl("/editormd/lib/");
function create_editorMD(id, width, high, placeholder, imageUrl,initValue, callback) {
var editorName = window.editormd(id, {
width: width,
height: high,
path: path, // "/editormd/lib/"
markdown : initValue,
syncScrolling: "single",
tex: true,
tocm: true,
emoji: true,
taskList: true,
codeFold: true,
searchReplace: true,
htmlDecode: "style,script,iframe",
sequenceDiagram: true,
autoFocus: false,
placeholder: placeholder,
toolbarIcons: function () {
// Or return editormd.toolbarModes[name]; // full, simple, mini
// Using "||" set icons align right.
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
},
toolbarCustomIcons: {
testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
},
//这个配置在simple.html中并没有但是为了能够提交表单使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中方便post提交表单。
saveHTMLToTextarea: true,
// 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标
dialogMaskOpacity: 0.6,
imageUpload: true,
imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
imageUploadURL: imageUrl,//url
onload: function () {
// this.previewing();
var id = this.id;
var editorName = this;
$("#" + id + " [type=\"latex\"]").bind("click", function () {
editorName.cm.replaceSelection("```latex");
editorName.cm.replaceSelection("\n");
editorName.cm.replaceSelection("\n");
editorName.cm.replaceSelection("```");
var __Cursor = editorName.cm.getDoc().getCursor();
editorName.cm.setCursor(__Cursor.line - 1, 0);
});
$("#" + id + " [type=\"inline\"]").bind("click", function () {
editorName.cm.replaceSelection("`$$$$`");
var __Cursor = editorName.cm.getDoc().getCursor();
editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3);
editorName.cm.focus();
});
$("[type=\"inline\"]").attr("title", "行内公式");
$("[type=\"latex\"]").attr("title", "多行公式");
callback && callback()
}
});
// 一个页面有多个md时onload方法只执行了一次
// window.md_elocalStorage(editorName, `MemoQuestion_${id}`, `${id}`);
return editorName;
}
class PathNew extends Component{ class PathNew extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.contentMdRef = React.createRef();
this.Point_editMD = React.createRef();
this.state={ this.state={
pathName:"", pathName:"",
description:"", description:"",
@ -104,7 +37,7 @@ class PathNew extends Component{
}) })
return; return;
} }
let des=this.Des_editMD.getValue(); let des= this.contentMdRef.current.getValue().trim();
if(des===""){ if(des===""){
this.props.showSnackbar("请输入实践课程的简介"); this.props.showSnackbar("请输入实践课程的简介");
window.location.href="#part_Des"; window.location.href="#part_Des";
@ -115,7 +48,7 @@ class PathNew extends Component{
window.location.href="#part_Des"; window.location.href="#part_Des";
return; return;
} }
let point = this.Point_editMD.getValue(); let point = this.Point_editMD.current.getValue().trim();
if(point===""){ if(point===""){
this.props.showSnackbar("请输入实践课程的学习须知"); this.props.showSnackbar("请输入实践课程的学习须知");
window.location.href="#part_point"; window.location.href="#part_point";
@ -207,13 +140,9 @@ class PathNew extends Component{
this.setState({ this.setState({
pathName: response.data.name pathName: response.data.name
}) })
this.contentMdRef.current.setValue(response.data && response.data.description);
this.Point_editMD.current.setValue(response.data && response.data.learning_notes);
const Des_editMD = create_editorMD("shixun_introduction","100%","490px"
,"请在此输入实践课程的简介最大限制8000个字符","/api/attachments.json", response.data.description,"");
this.Des_editMD=Des_editMD;
const Point_editMD = create_editorMD("shixun_propaedeutics","100%","260px"
,"请在此输入实践课程的学习须知最大限制2000个字符","/api/attachments.json",response.data.learning_notes,"");
this.Point_editMD=Point_editMD;
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -221,10 +150,8 @@ class PathNew extends Component{
} else { } else {
this.isEditPage = false this.isEditPage = false
const Des_editMD = create_editorMD("shixun_introduction","100%","490px","请在此输入实践课程的简介最大限制8000个字符","/api/attachments.json","",""); this.contentMdRef.current.setValue("");
this.Des_editMD=Des_editMD; this.Point_editMD.current.setValue("");
const Point_editMD = create_editorMD("shixun_propaedeutics","100%","260px","请在此输入实践课程的学习须知最大限制2000个字符","/api/attachments.json","","");
this.Point_editMD=Point_editMD;
} }
} }
@ -266,8 +193,14 @@ class PathNew extends Component{
<div className="df"> <div className="df">
<span className="mr30 color-orange pt10">*</span> <span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20"> <div className="flex1 mr20">
<div id="shixun_introduction" className="new_li editormd editormd-vertical"> <div id="shixun_introduction" className="new_li">
<textarea className="input-100-45" name="description" placeholder="请在此输入实践课程的简介" value={description}></textarea> {/*<textarea className="input-100-45" name="description" placeholder="请在此输入实践课程的简介" value={description}></textarea>*/}
<TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入实践课程的简介最大限制8000个字符" mdID={'courseContentMD'}
refreshTimeout={1500}
className="courseMessageMD"
// initValue={this.state.description === null ? "" : this.state.description}
></TPMMDEditor>
</div> </div>
<p id="e_tip_shixun_introduction" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tip_shixun_introduction" className="edu-txt-right color-grey-cd font-12"></p>
<p id="e_tips_shixun_introduction" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tips_shixun_introduction" className="edu-txt-right color-grey-cd font-12"></p>
@ -280,8 +213,13 @@ class PathNew extends Component{
<div className="df"> <div className="df">
<span className="mr30 color-orange pt10">*</span> <span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20"> <div className="flex1 mr20">
<div id="shixun_propaedeutics" className="new_li editormd editormd-vertical"> <div id="shixun_propaedeutics" className="new_li ">
<textarea name="learning_notes" placeholder="请在此输入实践课程的学习须知" value={point}></textarea> {/*<textarea name="learning_notes" placeholder="请在此输入实践课程的学习须知" value={point}></textarea>*/}
<TPMMDEditor ref={this.Point_editMD} placeholder="请在此输入实践课程的学习须知最大限制2000个字符" mdID={'Point_editMDs'}
refreshTimeout={1500}
className="courseMessageMD"
// initValue={this.state.description === null ? "" : this.state.description}
></TPMMDEditor>
</div> </div>
<p id="e_tip_shixun_propaedeutics" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tip_shixun_propaedeutics" className="edu-txt-right color-grey-cd font-12"></p>
<p id="e_tips_shixun_propaedeutics" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tips_shixun_propaedeutics" className="edu-txt-right color-grey-cd font-12"></p>

@ -4,7 +4,7 @@ import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
import { getImageUrl, toPath, getUrl } from 'educoder'; import { getImageUrl, getUploadActionUrl, getUrl } from 'educoder';
require('codemirror/lib/codemirror.css'); require('codemirror/lib/codemirror.css');
@ -222,7 +222,7 @@ export default class MDEditors extends Component {
const _placeholder = placeholder || ""; const _placeholder = placeholder || "";
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
// 创建editorMd // 创建editorMd
let react_id = `react_${_id}`; let react_id = `react_${_id}`;

@ -15,7 +15,7 @@ import axios from 'axios';
import './css/TPMsettings.css'; import './css/TPMsettings.css';
import { getImageUrl, toPath, getUrl ,appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder'; import { getImageUrl, toPath, getUrl ,getUploadActionUrl} from 'educoder';
let origin = getUrl(); let origin = getUrl();
@ -280,7 +280,7 @@ export default class TPMsettings extends Component {
const placeholder = ""; const placeholder = "";
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
// 创建editorMd // 创建editorMd
const description_editormd =create_editorMD(id, '100%', 400, placeholder, imageUrl, initValue,()=> { const description_editormd =create_editorMD(id, '100%', 400, placeholder, imageUrl, initValue,()=> {
@ -307,7 +307,7 @@ export default class TPMsettings extends Component {
const placeholder = ""; const placeholder = "";
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
// 创建editorMd // 创建editorMd
const evaluate_script_editormd =create_editorMD(id, '100%', 400, placeholder, imageUrl, initValue,()=> { const evaluate_script_editormd =create_editorMD(id, '100%', 400, placeholder, imageUrl, initValue,()=> {

@ -6,7 +6,7 @@ import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
import { getImageUrl, toPath, getUrl } from 'educoder'; import { getImageUrl, getUploadActionUrl, getUrl } from 'educoder';
import '../../courses/css/Courses.css' import '../../courses/css/Courses.css'
import axios from 'axios'; import axios from 'axios';
@ -226,7 +226,7 @@ export default class TPMMDEditor extends Component {
const _placeholder = placeholder || ""; const _placeholder = placeholder || "";
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
// 创建editorMd // 创建editorMd
let react_id = `react_${_id}`; let react_id = `react_${_id}`;
// 将实例存到了window // 将实例存到了window

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {getUrl} from 'educoder'; import {getUrl,getUploadActionUrl} from 'educoder';
let path = getUrl("/editormd/lib/"); let path = getUrl("/editormd/lib/");
@ -85,7 +85,7 @@ export default class TPMeditorMD extends Component {
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
// const imageUrl = `/upload_with_markdown?container_id=&container_type=Memo`; // const imageUrl = `/upload_with_markdown?container_id=&container_type=Memo`;
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
// 创建editorMd // 创建editorMd
let questio_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => { let questio_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => {

@ -6,7 +6,7 @@ import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
import { getImageUrl, toPath, getUrl } from 'educoder'; import { getImageUrl, getUploadActionUrl, getUrl } from 'educoder';
import axios from 'axios'; import axios from 'axios';
@ -170,7 +170,7 @@ export default class TPManswer extends Component {
const placeholder = ""; const placeholder = "";
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
const imageUrl = `/api/attachments.json`; const imageUrl = `${getUploadActionUrl()}`;
// 创建editorMd // 创建editorMd
const answers_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => { const answers_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => {

@ -243,7 +243,7 @@ class Newshixuns extends Component {
const placeholder = ""; const placeholder = "";
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
const imageUrl = `/api/attachments.json`; const imageUrl = `getUploadActionUrl`;
// 创建editorMd // 创建editorMd
const taskpass_editormd = create_editorMD("memoMD", '100%', 400, placeholder, imageUrl, () => { const taskpass_editormd = create_editorMD("memoMD", '100%', 400, placeholder, imageUrl, () => {

@ -1,7 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Modal } from "antd"; import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Modal } from "antd";
import axios from 'axios' import axios from 'axios'
import { WordsBtn, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder' import { getUploadActionUrl, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder'
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
const $ = window.$; const $ = window.$;
const MAX_TITLE_LENGTH = 60; const MAX_TITLE_LENGTH = 60;
@ -191,7 +191,7 @@ class NewGtaskForms extends Component{
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleContentUploadChange, onChange: this.handleContentUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'), onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'),
beforeUpload: (file) => { beforeUpload: (file) => {

Loading…
Cancel
Save