Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

# Conflicts:
#	public/react/src/modules/paths/PathDetail/DetailTop.js
#	public/react/src/modules/paths/PathDetail/PathDetailIndex.js
dev_oauth
杨树林 6 years ago
commit b36aeb5293

@ -42,4 +42,13 @@ module Util
return '' if str.blank? return '' if str.blank?
str.gsub(/<\/?.*?>/, '').gsub(/[\n\t\r]/, '').gsub(/&nbsp;/, '') str.gsub(/<\/?.*?>/, '').gsub(/[\n\t\r]/, '').gsub(/&nbsp;/, '')
end end
def conceal(str, type = nil)
str = str.to_s
case type
when :phone then "#{str[0..2]}***#{str[-4..-1]}"
when :email then "#{str[0..2]}***#{str[str.rindex('@')..-1]}"
else "#{str[0..2]}***#{str[-3..-1]}"
end
end
end end

@ -11,7 +11,7 @@ class Users::BindEmailService < ApplicationService
def call def call
Users::BindEmailForm.new(params).validate! Users::BindEmailForm.new(params).validate!
raise Error, '该邮箱已被绑定' if User.where.not(id: user.id).exists?(mail: params[:email]) raise Error, '该邮箱已被其他账号绑定' if User.where.not(id: user.id).exists?(mail: params[:email])
code = VerificationCode.where(email: params[:email], code: params[:code], code_type: 5).last code = VerificationCode.where(email: params[:email], code: params[:code], code_type: 5).last
raise Error, '验证码无效' unless code&.effective? raise Error, '验证码无效' unless code&.effective?

@ -11,7 +11,7 @@ class Users::BindPhoneService < ApplicationService
def call def call
Users::BindPhoneForm.new(params).validate! Users::BindPhoneForm.new(params).validate!
raise Error, '该手机号已被绑定' if User.where.not(id: user.id).exists?(phone: params[:phone]) raise Error, '该手机号已被其他账号绑定' if User.where.not(id: user.id).exists?(phone: params[:phone])
code = VerificationCode.where(phone: params[:phone], code: params[:code], code_type: 4).last code = VerificationCode.where(phone: params[:phone], code: params[:code], code_type: 4).last
raise Error, '验证码无效' unless code&.effective? raise Error, '验证码无效' unless code&.effective?

@ -58,7 +58,7 @@ namespace :public_course do
# 更新某个课程的某类时间 # 更新某个课程的某类时间
# 执行示例 bundle exec rake public_course:time args=-1,2932,1,1 # 执行示例 RAILS_ENV=production bundle exec rake public_course:time args=-1,2932,1,1
task :time => :environment do task :time => :environment do
# course_id = ENV['args'].split(",")[0] # 对应课堂的id # course_id = ENV['args'].split(",")[0] # 对应课堂的id
# type = ENV['args'].split(",")[1] # type = ENV['args'].split(",")[1]
@ -69,14 +69,15 @@ namespace :public_course do
when 1 when 1
# 讨论区 # 讨论区
created_on = random_time start_time, end_time created_on = random_time start_time, end_time
puts created_on
messages = Message.where(board_id: course.boards) messages = Message.where(board_id: course.boards)
message_details = MessageDetail.where(message_id: messages) messages.each do |message|
messages.update_columns(created_on: created_on, updated_on: created_on) message.update_columns(created_on: created_on, updated_on: created_on)
message_details.update_columns(created_at: created_on, updated_at: created_on) MessageDetail.where(message_id: message.id).update_all(created_at: created_on, updated_at: created_on)
end
when 2 when 2
# 作业 # 作业
course.homework_commons.each do |homework| course.homework_commons.each do |homework|
created_at = random_time(start_time, end_time) created_at = random_time(start_time, end_time)
publish_time = random_larger_time created_at, start_time, end_time publish_time = random_larger_time created_at, start_time, end_time
end_time = random_larger_time publish_time, start_time, end_time end_time = random_larger_time publish_time, start_time, end_time

@ -0,0 +1,67 @@
# add test user
namespace :sync do
task :add_user => :environment do
DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
user_count = ENV['args'].split(",")[0].to_i # 用户数
rand_chart = ENV['args'].split(",")[1] # 手机号或者邮箱等前面的随机数
puts rand_chart
puts user_count
(1..user_count).each do |i|
puts i
no = sprintf("%04d", i)
phone = "#{rand_chart}160731#{no}"
mail = "#{rand_chart}#{no}@educoder.net"
code = generate_identifier User, 8
login = "m" + code
l = "赵,钱,孙,李,周,吴,郑,王,冯,陈,褚,卫,蒋,沈,韩,杨,朱,秦,尤,许,何,吕,施,张,孔,曹,严,华,金,魏,陶,姜,黄".split(",")
f = "爱童,安妮,若婷,安煜,博,雷,梅,静,士红,大龙,冰波,慧娟,梅,婧婧,军,淋,真,维,涛,程程,
,,,,,,,,,,,,,,,,访,,,绿,,
,,访,,,,,,,,,,,,访,,,,,,,
,,,,,,,,,,,,,,,,,,绿,,,
,,,,,,,,,,访,,绿,,,,,,,,,
,,绿,,,,,,,,,,,,,,,,,,,
,绿,,,,,,,,,,绿,,,,,,,,,,
,,,,,,,,,,,,,,,,,".split(",")
lastname = l[rand(l.length)].strip + f[rand(f.length)].strip
edit_params = {
login: login,
admin: false,
type: User,
phone: phone,
lastname: lastname,
mail: mail,
authentication: 1,
professional_certification: 1,
profile_completed: true,
is_test: true
}
user = User.create!(edit_params)
puts "aa"
UserExtension.create!(user_id: user.id, school_id: 117)
puts i
end
end
# 随机生成字符
def generate_identifier(container, num)
code = DCODES.sample(num).join
if container == User
while container.exists?(login: code) do
code = DCODES.sample(num).join
end
else
while container.exists?(identifier: code) do
code = DCODES.sample(num).join
end
end
code
end
end

@ -193,10 +193,10 @@ function generateNewIndexJsp() {
} }
const newVersion = '1.1.1' const newVersion = '1.1.1'
let cdnHost = 'https://shixun.educoder.net' let cdnHost = 'https://shixun.educoder.net'
cdnHost = 'http://cdn.educoder.net' cdnHost = 'https://ali-cdn.educoder.net'
cdnHost = '' // cdnHost = ''
var result = data.replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`) var result = data.replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`)
.replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`) // .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`)
.replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`) .replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`)
.replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`) .replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`)

@ -74,3 +74,12 @@ html, body {
.formItemInline .ant-form-item-control-wrapper { .formItemInline .ant-form-item-control-wrapper {
flex: 1; flex: 1;
} }
/* 兼容性 */
/* 火狐有滚动条时高度问题 */
@-moz-document url-prefix() {
.newContainers {
min-height: calc(100% - 60px) !important;
}
}

@ -1,4 +1,5 @@
const isDev = window.location.port == 3007; const isDev = window.location.port == 3007;
export const TEST_HOST = "http://47.96.87.25:48080"
export function getImageUrl(path) { export function getImageUrl(path) {
// https://www.educoder.net // https://www.educoder.net
// https://testbdweb.trustie.net // https://testbdweb.trustie.net

@ -4,7 +4,7 @@ import { from } from '_array-flatten@2.1.2@array-flatten';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getUploadActionUrl as getUploadActionUrl, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById } from './UrlTool'; , getTaskUrlById as getTaskUrlById, TEST_HOST } from './UrlTool';
export { default as queryString } from './UrlTool2'; export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC'; export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';

@ -539,6 +539,8 @@ pop_box_new(htmlvalue, 480, 182);
.then((response) => { .then((response) => {
// {"status":1,"message":"Unauthorized. \u7528\u6237\u8ba4\u8bc1\u5931\u8d25."} // {"status":1,"message":"Unauthorized. \u7528\u6237\u8ba4\u8bc1\u5931\u8d25."}
window.__fetchAllFlag = false;
if (response.data.status == 403) { if (response.data.status == 403) {
window.location.href = "/403"; window.location.href = "/403";
return; return;

@ -70,7 +70,7 @@ class ModulationModal extends Component{
destroyOnClose={true} destroyOnClose={true}
> >
<div className="task-popup-content"> <div className="task-popup-content">
<p className="task-popup-text-center font-16"> <p className="task-popup-text-center font-16 mb20">
<span className={"color-dark-21"}>该学生的最终成绩将不会按照评分规则进行计算</span> <span className={"color-dark-21"}>该学生的最终成绩将不会按照评分规则进行计算</span>

@ -632,89 +632,89 @@ class Selectsetting extends Component{
{this.state.newfileListtypes===true?<p className={"color-red"}>请先上传资源</p>:""} {this.state.newfileListtypes===true?<p className={"color-red"}>请先上传资源</p>:""}
<p className={"winth540"}> {/*<p className={"winth540"}>*/}
<style>{` {/*<style>{`*/}
.ant-checkbox-wrapper{ {/*.ant-checkbox-wrapper{*/}
margin-left:0px !important; {/*margin-left:0px !important;*/}
margin-top:10px; {/*margin-top:10px;*/}
} {/*}*/}
`}</style> {/*`}</style>*/}
<div className={this.state.fileListtype===true?"mt30":""}> {/*<div className={this.state.fileListtype===true?"mt30":""}>*/}
<Checkbox {/*<Checkbox*/}
checked={is_public} {/*checked={is_public}*/}
onChange={this.onChangepublics}> {/*onChange={this.onChangepublics}>*/}
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span> {/*<span className={"font-14"}>勾选后所有用户可见,否则仅课堂成员可见</span>*/}
</Checkbox> {/*</Checkbox>*/}
</div> {/*</div>*/}
{/*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*/} {/*/!*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*!/*/}
{/*{this.state.course_groupss&&this.state.course_groupss.length>0?<Checkbox*/} {/*/!*{this.state.course_groupss&&this.state.course_groupss.length>0?<Checkbox*!/*/}
{/*checked={unified_setting}*/} {/*/!*checked={unified_setting}*!/*/}
{/*onChange={this.onChangesettings}>*/} {/*/!*onChange={this.onChangesettings}>*!/*/}
{/*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*/} {/*/!*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*!/*/}
{/*</Checkbox>:""}*/} {/*/!*</Checkbox>:""}*!/*/}
<style> {/*<style>*/}
{` {/*{`*/}
.Selectleft20{ {/*.Selectleft20{*/}
margin-left: 20px !important; {/*margin-left: 20px !important;*/}
width: 176px; {/*width: 176px;*/}
height: 40px; {/*height: 40px; */}
} {/*}*/}
.resourcebox{ {/*.resourcebox{*/}
max-height:150px; {/*max-height:150px;*/}
overflow: auto; {/*overflow: auto;*/}
} {/*}*/}
`} {/*`}*/}
</style> {/*</style>*/}
{/*this.props.has_course_groups&&this.props.has_course_groups===true?:""*/} {/*/!*this.props.has_course_groups&&this.props.has_course_groups===true?:""*!/*/}
<div className={"resourcebox"}> {/*<div className={"resourcebox"}>*/}
{unified_setting===false? {/*{unified_setting===false?*/}
this.state.course_groups&&this.state.course_groups.map((item,key)=>{ {/*this.state.course_groups&&this.state.course_groups.map((item,key)=>{*/}
return( {/*return(*/}
<div className={"mt10 "} key={key}> {/*<div className={"mt10 "} key={key}>*/}
<Select placeholder="请选择分班名称" {/*<Select placeholder="请选择分班名称"*/}
value={item.course_group_id} {/*value={item.course_group_id}*/}
style={{ width: 200 }} {/*style={{ width: 200 }}*/}
onChange={(e,index)=>this.selectassigngroups(e,index,key)} {/*onChange={(e,index)=>this.selectassigngroups(e,index,key)}*/}
> {/*>*/}
{ this.state.course_groupss&&this.state.course_groupss.map((item,key)=>{ {/*{ this.state.course_groupss&&this.state.course_groupss.map((item,key)=>{*/}
return( {/*return(*/}
<Option value={item.id} key={key}>{item.name}</Option> {/*<Option value={item.id} key={key}>{item.name}</Option>*/}
) {/*)*/}
})} {/*})}*/}
</Select> {/*</Select>*/}
<DatePicker {/*<DatePicker*/}
showToday={false} {/*showToday={false}*/}
dropdownClassName="hideDisable" {/*dropdownClassName="hideDisable"*/}
showTime={{ format: 'HH:mm' }} {/*showTime={{ format: 'HH:mm' }}*/}
format="YYYY-MM-DD HH:mm" {/*format="YYYY-MM-DD HH:mm"*/}
locale={locale} {/*locale={locale}*/}
placeholder="请选择发布时间" {/*placeholder="请选择发布时间"*/}
id={"startimes"} {/*id={"startimes"}*/}
className={"Selectleft20"} {/*className={"Selectleft20"}*/}
width={"200px"} {/*width={"200px"}*/}
value={item.publish_time===undefined||item.publish_time===""?"":item.publish_time===null?"":moment(item.publish_time, dateFormat)} {/*value={item.publish_time===undefined||item.publish_time===""?"":item.publish_time===null?"":moment(item.publish_time, dateFormat)}*/}
onChange={(e,index)=>this.onChangeTimepublishs(e,index,key)} {/*onChange={(e,index)=>this.onChangeTimepublishs(e,index,key)}*/}
// onChange={ this.onChangeTimepublish } {/*// onChange={ this.onChangeTimepublish }*/}
disabledTime={disabledDateTime} {/*disabledTime={disabledDateTime}*/}
disabledDate={disabledDate} {/*disabledDate={disabledDate}*/}
/> {/*/>*/}
{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""} {/*{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}*/}
{key===course_groups.length-1?<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>:""} {/*{key===course_groups.length-1?<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>:""}*/}
</div> {/*</div>*/}
) {/*)*/}
}):""} {/*}):""}*/}
</div> {/*</div>*/}
</p> {/*</p>*/}
<style> <style>
{` {`
#startime .ant-calendar-picker-icon{ #startime .ant-calendar-picker-icon{
@ -723,7 +723,7 @@ class Selectsetting extends Component{
`} `}
</style> </style>
{unified_setting===true? {unified_setting===true?
<p className={"mt10"}> <p className={this.state.fileListtype===true?"mt30":""}>
<span> <span>
<DatePicker <DatePicker
showToday={false} showToday={false}

@ -469,81 +469,81 @@ class Sendresource extends Component{
{newfileListtype===true&&this.state.fileListtype===false?<p className={"color-red"}>请先上传资源</p>:""} {newfileListtype===true&&this.state.fileListtype===false?<p className={"color-red"}>请先上传资源</p>:""}
<p className={"winth540"}> {/*<p className={"winth540"}>*/}
<style>{` {/*<style>{`*/}
.ant-checkbox-wrapper{ {/*.ant-checkbox-wrapper{*/}
margin-left:0px !important; {/*margin-left:0px !important;*/}
margin-top:10px; {/*margin-top:10px;*/}
} {/*}*/}
`}</style> {/*`}</style>*/}
<div className={this.state.fileListtype===true?"mt30":""}></div><Checkbox checked={is_public} onChange={this.onChangepublic}> {/*<div className={this.state.fileListtype===true?"mt30":""}></div><Checkbox checked={is_public} onChange={this.onChangepublic}>*/}
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span> {/*<span className={"font-14"}>勾选后所有用户可见,否则仅课堂成员可见</span>*/}
</Checkbox> {/*</Checkbox>*/}
{/*{this.state.course_groups_count&&this.state.course_groups_count>0?<Checkbox checked={is_unified_setting} onChange={this.onChangesetting}>*/} {/*/!*{this.state.course_groups_count&&this.state.course_groups_count>0?<Checkbox checked={is_unified_setting} onChange={this.onChangesetting}>*!/*/}
{/*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*/} {/*/!*<span>统一设置</span><span className={"font-14 color-grey-9"}>(选中则所有分班使用相同的发布设置,否则各个单独设置)</span>*!/*/}
{/*</Checkbox>:""}*/} {/*/!*</Checkbox>:""}*!/*/}
<style>{` {/*<style>{`*/}
.Selectleft20{ {/*.Selectleft20{*/}
margin-left: 20px !important; {/*margin-left: 20px !important;*/}
width: 176px; {/*width: 176px;*/}
height: 40px; {/*height: 40px; */}
} {/*}*/}
#startimes .ant-calendar-picker-icon{ {/*#startimes .ant-calendar-picker-icon{*/}
margin-top:-11px; {/*margin-top:-11px;*/}
} {/*}*/}
.resourcebox{ {/*.resourcebox{*/}
max-height:150px; {/*max-height:150px;*/}
overflow: auto; {/*overflow: auto;*/}
} {/*}*/}
`}</style> {/*`}</style>*/}
<div className={"resourcebox"}> {/*<div className={"resourcebox"}>*/}
{is_unified_setting===false? {/*{is_unified_setting===false?*/}
course_group_publish_times.map((item,key)=>{ {/*course_group_publish_times.map((item,key)=>{*/}
return( {/*return(*/}
<div className={"mt10"} key={key}> {/*<div className={"mt10"} key={key}>*/}
<Select placeholder="请选择分班名称" {/*<Select placeholder="请选择分班名称"*/}
value={item.course_group_id} {/*value={item.course_group_id}*/}
style={{ width: 200 }} {/*style={{ width: 200 }}*/}
onChange={(e,index)=>this.selectassigngroups(e,index,key)} {/*onChange={(e,index)=>this.selectassigngroups(e,index,key)}*/}
> {/*>*/}
{course_groups&&course_groups.map((item,key)=>{ {/*{course_groups&&course_groups.map((item,key)=>{*/}
return( {/*return(*/}
<Option value={item.id} key={key}>{item.name}</Option> {/*<Option value={item.id} key={key}>{item.name}</Option>*/}
) {/*)*/}
})} {/*})}*/}
</Select> {/*</Select>*/}
<DatePicker {/*<DatePicker*/}
dropdownClassName="hideDisable" {/*dropdownClassName="hideDisable"*/}
showTime={{ format: 'HH:mm' }} {/*showTime={{ format: 'HH:mm' }}*/}
locale={locale} {/*locale={locale}*/}
showToday={false} {/*showToday={false}*/}
format={dateFormat} {/*format={dateFormat}*/}
placeholder="请选择发布时间" {/*placeholder="请选择发布时间"*/}
id={"startimes"} {/*id={"startimes"}*/}
className={"Selectleft20 "} {/*className={"Selectleft20 "}*/}
width={"200px"} {/*width={"200px"}*/}
value={item.publish_time===undefined||item.publish_time===""?undefined:moment(item.publish_time, dateFormat)} {/*value={item.publish_time===undefined||item.publish_time===""?undefined:moment(item.publish_time, dateFormat)}*/}
onChange={(e,index)=>this.onChangeTimepublish(e,index,key,2)} {/*onChange={(e,index)=>this.onChangeTimepublish(e,index,key,2)}*/}
// onChange={ this.onChangeTimepublish } {/*// onChange={ this.onChangeTimepublish }*/}
disabledTime={disabledDateTime} {/*disabledTime={disabledDateTime}*/}
disabledDate={disabledDate} {/*disabledDate={disabledDate}*/}
/> {/*/>*/}
{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""} {/*{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}*/}
{key===course_group_publish_times.length-1&&key<this.state.course_groups_count-1?<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>:""} {/*{key===course_group_publish_times.length-1&&key<this.state.course_groups_count-1?<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>:""}*/}
</div> {/*</div>*/}
) {/*)*/}
}) {/*})*/}
:""} {/*:""}*/}
</div> {/*</div>*/}
</p> {/*</p>*/}
{is_unified_setting===true?<p className={"mt10"}> {is_unified_setting===true?<p className={this.state.fileListtype===true?"mt30":"mt10"}>
<span> <span>
<DatePicker <DatePicker
dropdownClassName="hideDisable" dropdownClassName="hideDisable"

@ -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} from 'educoder'; import { WordsBtn,getUrl ,bytesToSize,appendFileSizeToUploadFileAll,AttachmentList} 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';
@ -419,35 +419,35 @@ class GraduationTasksedit extends Component{
)} )}
</Form.Item> </Form.Item>
<input type="hidden" id='descriptiontypes' /> <input type="hidden" id='descriptiontypes' />
<AttachmentList {...this.props} {...this.state} attachments={attachments&&attachments}></AttachmentList>
{/*{attachments&&attachments.map((item,key)=>{*/}
{attachments&&attachments.map((item,key)=>{ {/*return(*/}
{/*<div className="color-grey mt5"*/}
return( {/*key={key}*/}
<div className="color-grey mt5" {/*>*/}
key={key} {/*<a className="color-grey ml3">*/}
> {/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
<a className="color-grey ml3"> {/*</a>*/}
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> {/*<a*/}
</a> {/*href={item.url}*/}
<a {/*className="mr12 color9B9B" length="58">*/}
href={item.url} {/*{item.title}*/}
className="mr12 color9B9B" length="58">
{item.title} {/*</a>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
</a> {/*{item.filesize}*/}
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.filesize} {/*</span>*/}
{/*{item.delete===true?*/}
</span> {/*<i className="font-14 iconfont icon-guanbi "*/}
{item.delete===true? {/*id={item.id}*/}
<i className="font-14 iconfont icon-guanbi " {/*onClick={()=>this.onAttachmentRemove(item.id)}*/}
id={item.id} {/*aria-hidden="true">*/}
onClick={()=>this.onAttachmentRemove(item.id)} {/*</i>:""}*/}
aria-hidden="true"> {/*</div>*/}
</i>:""} {/*)*/}
</div> {/*})}*/}
)
})}
<Upload {...uploadProps} fileList={this.state.fileList} className="upload_1 ml5"> <Upload {...uploadProps} fileList={this.state.fileList} className="upload_1 ml5">
<Button className="uploadBtn"> <Button className="uploadBtn">
<Icon type="upload" /> 上传附件 <Icon type="upload" /> 上传附件

@ -1,7 +1,7 @@
import React,{Component} from "React"; import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import { WordsBtn,markdownToHTML} from 'educoder'; import { WordsBtn,markdownToHTML,AttachmentList} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
import DownloadMessageysl from "../../../modals/DownloadMessageysl"; import DownloadMessageysl from "../../../modals/DownloadMessageysl";
@ -396,23 +396,23 @@ class GraduationTasksquestions extends Component{
} }
<div> <div>
{questionslist&&questionslist.attachments.map((item,key)=>{ {/*{questionslist&&questionslist.attachments.map((item,key)=>{*/}
return( {/*return(*/}
<div className="color-grey mt5"> {/*<div className="color-grey mt5">*/}
<a className="color-grey"> {/*<a className="color-grey">*/}
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> {/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
</a> {/*</a>*/}
<a href={item.url} {/*<a href={item.url}*/}
className="mr12" length="58"> {/*className="mr12" length="58">*/}
{item.title} {/*{item.title}*/}
</a> {/*</a>*/}
<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span> {/*<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>*/}
</div> {/*</div>*/}
) {/*)*/}
})} {/*})}*/}
<AttachmentList {...this.props} {...this.state} attachments={questionslist&&questionslist.attachments}></AttachmentList>
</div> </div>
{questionslist&&questionslist.group_info?<div> {questionslist&&questionslist.group_info?<div>

@ -298,6 +298,7 @@ class MainContentContainer extends Component {
}).then((fetchRepositoryCodeResponse) => { }).then((fetchRepositoryCodeResponse) => {
// monaca 需要刷新,不然无法编辑 // monaca 需要刷新,不然无法编辑
if (this.retryAndRefresh && fetchRepositoryCodeResponse.data.content) { if (this.retryAndRefresh && fetchRepositoryCodeResponse.data.content) {
this.retryAndRefresh = false;
window.location.reload() window.location.reload()
return; return;
} }

@ -1,11 +1,11 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { TEST_HOST } from 'educoder'
export function loadSshScript(callback) { export function loadSshScript(callback) {
let _url_origin = ``; let _url_origin = ``;
let prefix = 'react/build' let prefix = 'react/build'
if (window.location.port == 3007) { if (window.location.port == 3007) {
prefix = '' // prefix = ''
_url_origin = 'https://newweb.educoder.net/'; _url_origin = TEST_HOST + '/' // 'https://newweb.educoder.net/';
} else { } else {
// _url_origin = `https://testeduplus2.educoder.net/`; // _url_origin = `https://testeduplus2.educoder.net/`;
_url_origin = '/'; _url_origin = '/';

@ -620,8 +620,8 @@ class DetailCardsEditAndAdd extends Component{
</div> </div>
} }
{this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?<div className="click_add color-grey-9"> {this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?<div className="click_add color-grey-9" onClick={this.addStage}>
<span className="color-blue_4C" onClick={this.addStage}>+点击新建阶段</span>1 <span className="color-blue_4C" >+点击新建阶段</span>1
</div>:'':''} </div>:'':''}
</div> </div>
) )

@ -82,11 +82,12 @@ class DetailCardsEditAndEdit extends Component{
//打开选择实训弹框初始化tag标签和列表 //打开选择实训弹框初始化tag标签和列表
changeTag(id,search){ changeTag(id,search){
this.setState({ this.setState({
ChooseShixunListshixun_list:[],
page:1,
hometypepvisible:true hometypepvisible:true
}) })
let pathId=this.props.pathid; let pathId=this.props.pathid;
let {page}=this.state; let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+page
if(search!="" && search!=undefined){ if(search!="" && search!=undefined){
url+="&search="+search; url+="&search="+search;
} }
@ -523,7 +524,7 @@ class DetailCardsEditAndEdit extends Component{
` `
} }
</style> </style>
<div className="over180 pl20 pr20" {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":<div className="over180 pl20 pr20"
onScroll={this.contentViewScrolledit} onScroll={this.contentViewScrolledit}
> >
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}> <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
@ -552,7 +553,7 @@ class DetailCardsEditAndEdit extends Component{
}) })
} }
</Checkbox.Group> </Checkbox.Group>
</div> </div>}
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a> <a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>

@ -476,7 +476,7 @@ class PathDetailIndex extends Component{
</div> </div>
} }
{ {
this.props.checkIfLogin()===false?"123213":progress === undefined ? "" : progress === null ? "" : this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" :
<div className="edu-back-white myProgress padding40-20 mb10"> <div className="edu-back-white myProgress padding40-20 mb10">
<p className="mb20"> <p className="mb20">
<span className="font-16 mr10">我的进展</span> <span className="font-16 mr10">我的进展</span>

@ -37,7 +37,7 @@ function VideoUpload (props) {
</div> </div>
</div> </div>
<div> <div className="courseForm">
<span className="titleLabel">标题</span> <span className="titleLabel">标题</span>
<Input placeholder={`标题支持最多${MAX_LENGTH}个字符`} onInput={titleChange} maxLength={MAX_LENGTH} suffix={ <Input placeholder={`标题支持最多${MAX_LENGTH}个字符`} onInput={titleChange} maxLength={MAX_LENGTH} suffix={
<span className="color-grey-6 font-13">{String(title.length)}/{MAX_LENGTH}</span> <span className="color-grey-6 font-13">{String(title.length)}/{MAX_LENGTH}</span>

@ -61,6 +61,17 @@ function VideoUploadList (props) {
// alert("请先选择需要上传的文件!") // alert("请先选择需要上传的文件!")
return return
} }
// avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm
if (file.name
&& file.name.indexOf('.avi') == -1 && file.name.indexOf('.flv') == -1
&& file.name.indexOf('.f4v') == -1 && file.name.indexOf('.m4v') == -1
&& file.name.indexOf('.mov') == -1 && file.name.indexOf('.mp4') == -1
&& file.name.indexOf('.rmvb') == -1 && file.name.indexOf('.swf') == -1
&& file.name.indexOf('.webm') == -1
) {
showNotification(`不支持的视频格式`)
return;
}
if (file.size > 200 * 1024 * 1024) { if (file.size > 200 * 1024 * 1024) {
// 超过200m TODO // 超过200m TODO
clearInput() clearInput()

Loading…
Cancel
Save