diff --git a/app/controllers/users/private_message_details_controller.rb b/app/controllers/users/private_message_details_controller.rb
index fb87504e2..8e7b31212 100644
--- a/app/controllers/users/private_message_details_controller.rb
+++ b/app/controllers/users/private_message_details_controller.rb
@@ -3,6 +3,8 @@ class Users::PrivateMessageDetailsController < Users::BaseController
after_action :update_message_status, only: [:show]
+ helper_method :target_user
+
def show
messages = observed_user.private_messages.without_deleted.where(target: target_user)
diff --git a/app/models/memo.rb b/app/models/memo.rb
index e70a7cec9..d09251358 100644
--- a/app/models/memo.rb
+++ b/app/models/memo.rb
@@ -15,6 +15,7 @@ class Memo < ApplicationRecord
has_many :descendants, foreign_key: :root_id, class_name: 'Memo'
has_many :children, foreign_key: :parent_id, class_name: 'Memo'
has_many :attachments, as: :container, dependent: :destroy
+ has_many :tidings, as: :container, dependent: :destroy
scope :field_for_list, lambda{
select([:id, :subject, :author_id, :sticky, :updated_at, :language, :reward, :all_replies_count, :viewed_count, :forum_id])
diff --git a/app/services/users/update_account_service.rb b/app/services/users/update_account_service.rb
index c54353140..c8ba6da61 100644
--- a/app/services/users/update_account_service.rb
+++ b/app/services/users/update_account_service.rb
@@ -69,7 +69,7 @@ class Users::UpdateAccountService < ApplicationService
end
def sms_notify_admin name
- Educoder::Sms.send(mobile:'18182021083', send_type:'teacher_register', name: name, user_name:'管理员')
+ Educoder::Sms.send(mobile:'17680641960', send_type:'teacher_register', name: name, user_name:'管理员')
rescue => ex
Util.logger_error(ex)
end
diff --git a/app/views/users/private_message_details/show.json.jbuilder b/app/views/users/private_message_details/show.json.jbuilder
index 065767fb4..17d1a5e38 100644
--- a/app/views/users/private_message_details/show.json.jbuilder
+++ b/app/views/users/private_message_details/show.json.jbuilder
@@ -1,9 +1,13 @@
json.count @count
+json.target do
+ json.partial! 'users/user_simple', user: target_user
+end
json.messages do
json.array! @messages.each do |message|
json.extract! message, :id, :user_id, :receiver_id, :sender_id, :content
json.send_time message.display_send_time
+ json.send_day message.send_time.strftime('%Y-%m-%d')
json.sender do
json.partial! 'users/user_simple', user: message.sender
end
diff --git a/lib/educoder/sms.rb b/lib/educoder/sms.rb
index 6a47ebec6..a98ebf493 100644
--- a/lib/educoder/sms.rb
+++ b/lib/educoder/sms.rb
@@ -21,7 +21,7 @@ module Educoder
def self.notify_admin(opt)
opt[:name] = '管理员'
- opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '18182021083'
+ opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '18711085785'
send(opt)
end
@@ -39,27 +39,22 @@ module Educoder
params['text'] = "【Edu实训】" + code + "(手机验证码),有效期为10分钟。如非本人操作,请忽略。"
elsif send_type == 'competition_start'
params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛"
- Rails.logger.info "#{params['text']}"
elsif send_type == "teacher_register"
+ params['mobile'] = EduSetting.get('teacher_register_phone') || '17680641960'
params['text'] = "【Edu实训】亲爱的#{user_name},有新的老师#{name}注册啦,请尽快处理"
elsif send_type == 'subject_authorization' || send_type == 'shixun_authorization'
params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{name}#{send_type=='subject_authorization'?'实训路径':'实训'}发布申请#{result},请登录平台查看详情"
- Rails.logger.info "#{params['text']}"
elsif send_type == 'authentication_pro' || send_type == 'authentication'|| send_type == 'trial_authorization' || send_type == 'project_info'
params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{send_type == 'authentication_pro'?'职业认证':(send_type == 'authentication'? '实名认证' : (send_type == 'project_info'?'加入申请':'试用申请' ))}#{result},请登录平台查看详情"
- Rails.logger.info "#{params['text']}"
elsif send_type == "apply_pro_certification" || send_type == "apply_auth"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'apply_pro_certification'?'职业':'实名'}认证申请,请尽快处理"
- Rails.logger.info "#{params['text']}"
elsif send_type == "publish_subject" ||send_type == "publish_shixun"|| send_type == "user_apply_auth" || send_type == "discuss"
+ params['mobile'] = EduSetting.get('subject_shixun_notify_phone') || '18711011226' if send_type == "publish_subject" || send_type == "publish_shixun"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'publish_subject'?'实训路径':(send_type == 'publish_shixun' ? '实训' : (send_type == 'discuss' ? '实训评论':'试用'))}申请发布,请尽快处理"
- Rails.logger.info "#{params['text']}"
elsif send_type == 'join_course_multi_role'
params['text'] = "【Edu实训】亲爱的#{user_name},您的课堂#{name}有助教或者教师申请加入,请尽快审核"
- Rails.logger.info "#{params['text']}"
elsif send_type == 'applied_project_info'
params['text'] = "【Edu实训】亲爱的#{user_name},您的项目#{name}有成员申请加入,请尽快审核"
- Rails.logger.info "#{params['text']}"
end
http = Net::HTTP.new(send_tpl_sms_uri.host, send_tpl_sms_uri.port)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
index b8a5d450c..eb53fa373 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
@@ -75,14 +75,15 @@ class CommonWorkDetailIndex extends Component{
})
}
goback = () => {
- let workId=this.props.match.params.workId;
-
- if ( window.location.pathname.indexOf('appraise') == -1) {
- let category_id= this.state.category.category_id;
- this.props.toListPage(this.props.match.params, category_id)
- } else {
- this.props.toWorkListPage(this.props.match.params, workId)
- }
+ // let workId=this.props.match.params.workId;
+ //
+ // if ( window.location.pathname.indexOf('appraise') == -1) {
+ // let category_id= this.state.category.category_id;
+ // this.props.toListPage(this.props.match.params, category_id)
+ // } else {
+ // this.props.toWorkListPage(this.props.match.params, workId)
+ // }
+ this.props.history.goBack()
}
// 补交附件
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkPost.js b/public/react/src/modules/courses/busyWork/CommonWorkPost.js
index f2b92b47d..60383988b 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkPost.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkPost.js
@@ -262,8 +262,9 @@ class CommonWorkPost extends Component{
}
goback=()=>{
- this.props.toListPage(this.props.match.params, this.state.category ? this.state.category.category_id : '')
- }
+ // this.props.toListPage(this.props.match.params, this.state.category ? this.state.category.category_id : '')
+ this.props.history.goBack()
+ }
// 输入title
@@ -469,7 +470,7 @@ class CommonWorkPost extends Component{
}
gocannel=()=>{
- window.history.go(-1)
+ this.props.history.goBack()
}
render(){
diff --git a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js
index 2595b15b0..eef99bfcd 100644
--- a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js
+++ b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js
@@ -31,14 +31,15 @@ class WorkDetailPageHeader extends Component{
}
goback = () => {
- let workId=this.props.match.params.workId;
-
- if ( window.location.pathname.indexOf('appraise') == -1) {
- let category_id= this.props.category.category_id;
- this.props.toListPage(this.props.match.params, category_id)
- } else {
- this.props.toWorkListPage(this.props.match.params, this.props.match.params.category_id)
- }
+ // let workId=this.props.match.params.workId;
+ //
+ // if ( window.location.pathname.indexOf('appraise') == -1) {
+ // let category_id= this.props.category.category_id;
+ // this.props.toListPage(this.props.match.params, category_id)
+ // } else {
+ // this.props.toWorkListPage(this.props.match.params, this.props.match.params.category_id)
+ // }
+ this.props.history.goBack()
}
// 补交附件
Cancelvisible=()=>{
diff --git a/public/react/src/modules/courses/exercise/Ecercisemount.js b/public/react/src/modules/courses/exercise/Ecercisemount.js
index aa22b1f4a..13a6128de 100644
--- a/public/react/src/modules/courses/exercise/Ecercisemount.js
+++ b/public/react/src/modules/courses/exercise/Ecercisemount.js
@@ -1,247 +1,247 @@
-import React,{Component} from "React";
-import { Form, Select, Input, Button,Checkbox,DatePicker} from "antd";
-import locale from 'antd/lib/date-picker/locale/zh_CN';
-
-import "../css/Courses.css";
-import CoursesListType from '../coursesPublic/CoursesListType';
-
-const { Option } = Select;
-const CheckboxGroup = Checkbox.Group;
-
-class Ecercisemount extends Component{
-
- constructor(props){
- super(props)
- this.state={
-
- }
- }
-
- componentDidMount(){
-
- }
- handleSubmit = (e) => {
- e.preventDefault();
- this.props.form.validateFields((err, values) => {
- if (!err) {
- console.log('Received values of form: ', values);
- }
- });
- }
-
- handleSelectChange = (value) => {
- console.log(value);
- this.props.form.setFieldsValue({
- note: `Hi, ${value === 'male' ? 'man' : 'lady'}!`,
- });
- }
- render(){
- const { getFieldDecorator } = this.props.form;
- const dateFormat = 'YYYY-MM-DD HH:mm:ss';
- return(
-
-
-
-
-
-
-
-
Java语言之控制语句
-
-
-
-
返回
-
实训详情
-
-
-
-
-
-
-
-
-
- {/*
提交*/}
-
取消
-
-
-
-
-
-
-
-
-
-
-
- )
- }
-}
-const EcercisemountApp = Form.create({ name: 'coursesNew' })(Ecercisemount);
+import React,{Component} from "React";
+import { Form, Select, Input, Button,Checkbox,DatePicker} from "antd";
+import locale from 'antd/lib/date-picker/locale/zh_CN';
+
+import "../css/Courses.css";
+import CoursesListType from '../coursesPublic/CoursesListType';
+
+const { Option } = Select;
+const CheckboxGroup = Checkbox.Group;
+
+class Ecercisemount extends Component{
+
+ constructor(props){
+ super(props)
+ this.state={
+
+ }
+ }
+
+ componentDidMount(){
+
+ }
+ handleSubmit = (e) => {
+ e.preventDefault();
+ this.props.form.validateFields((err, values) => {
+ if (!err) {
+ console.log('Received values of form: ', values);
+ }
+ });
+ }
+
+ handleSelectChange = (value) => {
+ console.log(value);
+ this.props.form.setFieldsValue({
+ note: `Hi, ${value === 'male' ? 'man' : 'lady'}!`,
+ });
+ }
+ render(){
+ const { getFieldDecorator } = this.props.form;
+ const dateFormat = 'YYYY-MM-DD HH:mm:ss';
+ return(
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
提交*/}
+
取消
+
+
+
+
+
+
+
+
+
+
+
+ )
+ }
+}
+const EcercisemountApp = Form.create({ name: 'coursesNew' })(Ecercisemount);
export default EcercisemountApp;
\ No newline at end of file
diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
index c76e31b7a..b99bc783b 100644
--- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
+++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
@@ -248,13 +248,13 @@ class Testpapersettinghomepage extends Component{
// let category_id=this.props.match.params.category_id;
//
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id;
- let courseId=this.props.match.params.coursesId;
- if(courseId===undefined){
- this.props.history.push("/courses");
- }else{
- this.props.history.push(this.props.current_user.first_category_url);
- }
-
+ // let courseId=this.props.match.params.coursesId;
+ // if(courseId===undefined){
+ // this.props.history.push("/courses");
+ // }else{
+ // this.props.history.push(this.props.current_user.first_category_url);
+ // }
+ this.props.history.goBack()
}
render(){
let {tab,visible,Commonheadofthetestpaper}=this.state;
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js
index fbaa5b7c3..f93d13eac 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js
@@ -97,13 +97,13 @@ class GraduationTasksSubmitedit extends Component{
goback=()=>{
- let courseId=this.props.match.params.coursesId;
- if(courseId===undefined){
- this.props.history.push("/courses");
- }else{
- this.props.history.push(this.props.current_user.first_category_url);
- }
-
+ // let courseId=this.props.match.params.coursesId;
+ // if(courseId===undefined){
+ // this.props.history.push("/courses");
+ // }else{
+ // this.props.history.push(this.props.current_user.first_category_url);
+ // }
+ this.props.history.goBack()
}
@@ -362,7 +362,7 @@ class GraduationTasksSubmitedit extends Component{
}
gocannel=()=>{
- window.history.go(-1)
+ this.props.history.goBack()
}
handleSubmit=(e) => {
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js
index dddb11e53..f5060ad4c 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js
@@ -99,14 +99,14 @@ class GraduationTasksSubmitnew extends Component{
}
goback=()=>{
- let courseId=this.props.match.params.coursesId;
- if(courseId===undefined){
- this.props.history.push("/courses");
- }else{
- this.props.history.push(this.props.current_user.first_category_url);
- }
-
- }
+ // let courseId=this.props.match.params.coursesId;
+ // if(courseId===undefined){
+ // this.props.history.push("/courses");
+ // }else{
+ // this.props.history.push(this.props.current_user.first_category_url);
+ // }
+ this.props.history.goBack()
+ }
// 输入title
@@ -362,7 +362,7 @@ class GraduationTasksSubmitnew extends Component{
}
}
gocannel=()=>{
- window.history.go(-1)
+ this.props.history.goBack()
}
//公用数据
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js
index 5eccb2332..d01be4676 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js
@@ -70,13 +70,13 @@ class GraduationTasksappraise extends Component{
// let category_id=this.props.match.params.category_id;
//
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id;
- let courseId=this.props.match.params.coursesId;
- if(courseId===undefined){
- this.props.history.push("/courses");
- }else{
- this.props.history.push(this.props.current_user.first_category_url);
- }
-
+ // let courseId=this.props.match.params.coursesId;
+ // if(courseId===undefined){
+ // this.props.history.push("/courses");
+ // }else{
+ // this.props.history.push(this.props.current_user.first_category_url);
+ // }
+ this.props.history.goBack()
}
Cancelvisible=()=>{
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
index 2b55e0737..c96a6c60f 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
@@ -82,13 +82,13 @@ class GraduationTasksedit extends Component{
goback=()=>{
- let courseId = this.props.match.params.coursesId;
- if(courseId===undefined){
- this.props.history.push("/courses");
- }else{
- this.props.history.push(this.props.current_user.first_category_url);
- }
-
+ // let courseId = this.props.match.params.coursesId;
+ // if(courseId===undefined){
+ // this.props.history.push("/courses");
+ // }else{
+ // this.props.history.push(this.props.current_user.first_category_url);
+ // }
+ this.props.history.goBack()
}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js
index e27d8382b..1d3c7578f 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js
@@ -107,12 +107,13 @@ class GraduationTasksnew extends Component {
goback = () => {
- let courseId = this.props.match.params.coursesId;
- if(courseId===undefined){
- this.props.history.push("/courses");
- }else{
- this.props.history.push(this.props.current_user.first_category_url);
- }
+ // let courseId = this.props.match.params.coursesId;
+ // if(courseId===undefined){
+ // this.props.history.push("/courses");
+ // }else{
+ // this.props.history.push(this.props.current_user.first_category_url);
+ // }
+ this.props.history.goBack()
}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
index fc911e024..e679702da 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
@@ -765,12 +765,13 @@ class GraduationTaskssettingapp extends Component{
}
goback=()=>{
- let courseId=this.props.match.params.coursesId;
- if(courseId===undefined){
- this.props.history.push("/courses");
- }else{
- this.props.history.push(this.props.current_user.first_category_url);
- }
+ // let courseId=this.props.match.params.coursesId;
+ // if(courseId===undefined){
+ // this.props.history.push("/courses");
+ // }else{
+ // this.props.history.push(this.props.current_user.first_category_url);
+ // }
+ this.props.history.goBack()
}
isgoback=()=>{
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
index 1b98f00f3..816d53526 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
@@ -60,13 +60,13 @@ class GraduationTaskssettinglist extends Component{
goback=()=>{
// window.history.back(-1)
- let courseId=this.props.match.params.coursesId;
- if(courseId===undefined){
- this.props.history.push("/courses");
- }else{
- this.props.history.push(this.props.current_user.first_category_url);
- }
-
+ // let courseId=this.props.match.params.coursesId;
+ // if(courseId===undefined){
+ // this.props.history.push("/courses");
+ // }else{
+ // this.props.history.push(this.props.current_user.first_category_url);
+ // }
+ this.props.history.goBack()
}
seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
index a812bd803..6f030f26d 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
@@ -55,12 +55,14 @@ class GraduationTasksquestions extends Component{
// let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
- let courseId = this.props.match.params.coursesId;
- if(courseId===undefined){
- this.props.history.push("/courses");
- }else{
- this.props.history.push(this.props.current_user.first_category_url);
- }
+ // let courseId = this.props.match.params.coursesId;
+ // if(courseId===undefined){
+ // this.props.history.push("/courses");
+ // }else{
+ // this.props.history.push(this.props.current_user.first_category_url);
+ // }
+
+ this.props.history.goBack()
}
end=()=>{
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicPostWorksNew.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicPostWorksNew.js
index bc2f64538..50551adae 100644
--- a/public/react/src/modules/courses/graduation/topics/GraduateTopicPostWorksNew.js
+++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicPostWorksNew.js
@@ -265,7 +265,7 @@ class GraduateTopicPostWorksNew extends Component{