diff --git a/app/controllers/users/authentication_applies_controller.rb b/app/controllers/users/authentication_applies_controller.rb index 2fec6e0cd..6a2c20893 100644 --- a/app/controllers/users/authentication_applies_controller.rb +++ b/app/controllers/users/authentication_applies_controller.rb @@ -4,10 +4,16 @@ class Users::AuthenticationAppliesController < Users::BaseAccountController def create Users::ApplyAuthenticationService.call(observed_user, create_params) render_ok - rescue Users::ApplyAuthenticationService::Error => ex + rescue ApplicationService::Error => ex render_error(ex.message) end + def destroy + return render_error('已认证后不能撤销') if observed_user.authentication? + observed_user.process_real_name_apply&.revoke! + render_ok + end + private def create_params diff --git a/app/controllers/users/professional_auth_applies_controller.rb b/app/controllers/users/professional_auth_applies_controller.rb index b2603f642..5a9d305ff 100644 --- a/app/controllers/users/professional_auth_applies_controller.rb +++ b/app/controllers/users/professional_auth_applies_controller.rb @@ -8,6 +8,12 @@ class Users::ProfessionalAuthAppliesController < Users::BaseAccountController render_error(ex.message) end + def destroy + return render_error('已认证后不能撤销') if observed_user.professional_certification? + observed_user.process_professional_apply&.revoke! + render_ok + end + private def create_params diff --git a/app/services/users/apply_authentication_service.rb b/app/services/users/apply_authentication_service.rb index a96e13809..a9fa12638 100644 --- a/app/services/users/apply_authentication_service.rb +++ b/app/services/users/apply_authentication_service.rb @@ -1,6 +1,4 @@ class Users::ApplyAuthenticationService < ApplicationService - Error = Class.new(StandardError) - attr_reader :user, :params def initialize(user, params) diff --git a/config/routes.rb b/config/routes.rb index 523b1bd5d..65dd90cc2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -114,8 +114,8 @@ Rails.application.routes.draw do resource :password, only: [:update] resource :avatar, only: [:update] resource :auth_attachment, only: [:create] - resource :authentication_apply, only: [:create] - resource :professional_auth_apply, only: [:create] + resource :authentication_apply, only: [:create, :destroy] + resource :professional_auth_apply, only: [:create, :destroy] resources :open_users, only: [:destroy] end end diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index f6f8077d4..649aeab7a 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -3171,7 +3171,7 @@ class Listofworksstudentone extends Component { } daochuzuoye = () => { - let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?course_group=${this.state.checkedValuesineinfo === undefined || this.state.checkedValuesineinfo === null ? "" : this.state.checkedValuesineinfo}&search=${this.state.searchtext === undefined || this.state.searchtext === null ? "" : this.state.searchtext}` + let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?course_group=${this.state.checkedValuesineinfo === undefined || this.state.checkedValuesineinfo === null ? "" : this.state.checkedValuesineinfo}&work_status=${this.state.course_groupyslstwo === undefined || this.state.course_groupyslstwo === null ? "" : this.state.course_groupyslstwo}&search=${this.state.searchtext === undefined || this.state.searchtext === null ? "" : this.state.searchtext}` this.confirmysl(url); } diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index bfbccd0e4..f0ed674c0 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -666,7 +666,7 @@ class Trainingjobsetting extends Component { if (this.state.proportion === "自定义分值") { try { if(parseFloat(this.state.CalculateMax)!==parseFloat(max)){ - this.props.showNotification(`总分值不等于效率分和关卡分之和!`); + this.props.showNotification(`分值之和必须等于总分值:${this.state.CalculateMax}分`); this.scrollToAnchor("zongfentimeid"); return; } @@ -1275,7 +1275,7 @@ class Trainingjobsetting extends Component { this.Empiricalvalueratio(value, this.state.CalculateMax, true); } else if (this.state.proportion === "自定义分值") { - this.Calculatethetotalscore(value, this.state.challenge_settings); + // this.Calculatethetotalscore(value, this.state.challenge_settings); } } @@ -1321,7 +1321,16 @@ class Trainingjobsetting extends Component { if (this.state.completionefficiencyscore === true) { latedeductiontwos = this.state.latedeductiontwo; } - this.Calculatethetotalscore(latedeductiontwos, challenge_settings); + + if (this.state.proportion === "均分比例") { + this.Calculatethetotalscore(latedeductiontwos, challenge_settings); + + } else if (this.state.proportion === "经验值比例") { + this.Calculatethetotalscore(latedeductiontwos, challenge_settings); + + } + + // if (nubmer > 100) { // message.error("请输入小于100的数"); // this.setState({ @@ -2738,12 +2747,12 @@ class Trainingjobsetting extends Component { {this.state.challenge_settings === undefined ? "" : this.state.challenge_settings.map((object, index) => { return (