mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
init project
This commit is contained in:
23
app/controllers/users/authentication_applies_controller.rb
Normal file
23
app/controllers/users/authentication_applies_controller.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
class Users::AuthenticationAppliesController < Users::BaseAccountController
|
||||
before_action :private_user_resources!
|
||||
before_action :check_account, only: [:create]
|
||||
|
||||
def create
|
||||
Users::ApplyAuthenticationService.call(observed_user, create_params)
|
||||
render_ok
|
||||
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
|
||||
params.permit(:name, :show_realname, :gender, :id_number, :upload_image, attachment_ids: [])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user