Browse Source

操作记录记录显示调整

pull/347/head
xxq250 1 year ago
parent
commit
cb693dca8b
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/controllers/api/v1/users_controller.rb
  2. +1
    -1
      app/views/admins/user_actions/index.html.erb

+ 1
- 1
app/controllers/api/v1/users_controller.rb View File

@@ -131,7 +131,7 @@ class Api::V1::UsersController < Api::V1::BaseController
org_count = Organization.where(id: org_ids).count
project_count = Project.where(user_id: @observe_user.id).count
return tip_exception(-1, "当前账号名下存在未删除或退出的组织/仓库,请先删除或退出后再尝试注销操作.") if org_count > 0 || project_count > 0
UserAction.create(action_id: @observe_user.id, action_type: "DestroyUser", user_id: @observe_user.id, :ip => request.remote_ip, data_bank: @observe_user.attributes.to_json)
UserAction.create(action_id: @observe_user.id, action_type: "DestroyUser", user_id: @observe_user.id, :ip => request.remote_ip, data_bank: @observe_user.attributes.to_json, memo: params[:memo])
@result_object = Api::V1::Users::DeleteUserService.call(@observe_user)
if @result_object
return render_ok


+ 1
- 1
app/views/admins/user_actions/index.html.erb View File

@@ -8,7 +8,7 @@
<% action_type_options = [['自定义',''],['用户注销','DestroyUser'], ['删除项目', 'DestroyProject']] %>
<%= select_tag(:action_type_select, options_for_select(action_type_options), class: 'form-control') %>
<%= text_field_tag(:action_type, params[:action_type], class: 'form-control col-sm-2 ml-3',style: 'display:none;', placeholder: '自定义操作类型检索') %>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '用户名/邮箱/手机号检索') %>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '操作人用户名/邮箱/手机号检索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<% end %>



Loading…
Cancel
Save