Merge branches 'dev_Ysm' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysm

dev_hs
杨树明 6 years ago
commit 529a0ee365

@ -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
# course_id = ENV['args'].split(",")[0] # 对应课堂的id
# type = ENV['args'].split(",")[1]
@ -70,13 +70,13 @@ namespace :public_course do
# 讨论区
created_on = random_time start_time, end_time
messages = Message.where(board_id: course.boards)
message_details = MessageDetail.where(message_id: messages)
messages.update_columns(created_on: created_on, updated_on: created_on)
message_details.update_columns(created_at: created_on, updated_at: created_on)
messages.each do |message|
message.update_columns(created_on: created_on, updated_on: created_on)
MessageDetail.where(message_id: message.id).update_all(created_at: created_on, updated_at: created_on)
end
when 2
# 作业
course.homework_commons.each do |homework|
course.homework_commons.each do |homework|
created_at = random_time(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

@ -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

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

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

@ -61,6 +61,10 @@ function VideoUploadList (props) {
// alert("请先选择需要上传的文件!")
return
}
if (file.type && file.type.indexOf('ogm') != -1) {
showNotification(`不支持的视频格式`)
return;
}
if (file.size > 200 * 1024 * 1024) {
// 超过200m TODO
clearInput()

Loading…
Cancel
Save