dev_cs_new
杨树林 6 years ago
commit 369594c6ad

@ -222,7 +222,7 @@ class SubjectsController < ApplicationController
@subject.update_attributes(status: 1) @subject.update_attributes(status: 1)
ApplyAction.create(container_type: "ApplySubject", container_id: @subject.id, user_id: current_user.id, status: 0) ApplyAction.create(container_type: "ApplySubject", container_id: @subject.id, user_id: current_user.id, status: 0)
begin begin
status = Trustie::Sms.send(mobile: '18711011226', send_type:'publish_subject' , name: '管理员') status = Educoder::Sms.send(mobile: '18711011226', send_type:'publish_subject' , name: '管理员')
rescue => e rescue => e
uid_logger_error("发送验证码出错: #{e}") uid_logger_error("发送验证码出错: #{e}")
end end

@ -58,7 +58,7 @@ class DiscussesService
praise_count: 0, position: params[:position], challenge_id: params[:challenge_id], hidden: !current_user.admin? praise_count: 0, position: params[:position], challenge_id: params[:challenge_id], hidden: !current_user.admin?
) )
# 发送手机通知 # 发送手机通知
Trustie::Sms.send(mobile:'18173242757', send_type:'discuss', name:'管理员') Educoder::Sms.send(mobile:'18173242757', send_type:'discuss', name:'管理员')
rescue Exception => e rescue Exception => e
raise(e.message) raise(e.message)
end end

@ -51,6 +51,8 @@ class Users::UpdateAccountService < ApplicationService
if first_full_reward if first_full_reward
RewardGradeService.call(user, container_id: user.id, container_type: 'Account', score: 500) RewardGradeService.call(user, container_id: user.id, container_type: 'Account', score: 500)
sms_notify_admin if extension.teacher?
end end
user user
@ -65,4 +67,10 @@ class Users::UpdateAccountService < ApplicationService
def user_extension_attributes def user_extension_attributes
params.slice(*%i[location location_city identity student_id technical_title school_id department_id]) params.slice(*%i[location location_city identity student_id technical_title school_id department_id])
end end
def sms_notify_admin
Educoder::Sms.send(mobile:'18182021083', send_type:'teacher_register', name:'管理员')
rescue => ex
Util.logger_error(ex)
end
end end

@ -21,7 +21,7 @@ module Educoder
def self.notify_admin(opt) def self.notify_admin(opt)
opt[:name] = '管理员' opt[:name] = '管理员'
opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '17680641960' opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '18182021083'
send(opt) send(opt)
end end
@ -40,6 +40,8 @@ module Educoder
elsif send_type == 'competition_start' elsif send_type == 'competition_start'
params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛" params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛"
Rails.logger.info "#{params['text']}" Rails.logger.info "#{params['text']}"
elsif send_type == "teacher_register"
params['text'] = "【Edu实训】亲爱的#{user_name},有新的老师#{name}注册啦,请尽快处理"
elsif send_type == 'subject_authorization' || send_type == 'shixun_authorization' elsif send_type == 'subject_authorization' || send_type == 'shixun_authorization'
params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{name}#{send_type=='subject_authorization'?'':''}发布申请#{result},请登录平台查看详情" params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{name}#{send_type=='subject_authorization'?'':''}发布申请#{result},请登录平台查看详情"
Rails.logger.info "#{params['text']}" Rails.logger.info "#{params['text']}"

@ -52,6 +52,6 @@ html, body {
color: #f5222d; color: #f5222d;
} }
/* md多空格 */ /* md多空格 */
.markdown-body { .markdown-body p {
white-space: pre; white-space: pre-wrap;
} }

@ -9,7 +9,7 @@ export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('') window.$('#md_div').html('')
// markdown to html // markdown to html
if (selector && oldContent && oldContent.startsWith('<p')) { // 普通html处理 if (selector && oldContent && oldContent.startsWith('<p')) { // 普通html处理
window.$(selector).html(oldContent) window.$('#' + selector).html(oldContent)
} else { } else {
try { try {
// selector || // selector ||

Loading…
Cancel
Save