From babcb16c413a17ed15526d224b27d59695607ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Fri, 11 Nov 2022 14:54:54 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E5=9F=8B=E7=82=B9=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 7 +++++++ config/routes.rb | 1 + 2 files changed, 8 insertions(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c70f053f6..33fd93f83 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -57,6 +57,13 @@ class UsersController < ApplicationController Cache::V2::OwnerCommonService.new(@user.id).read end + def action + if params[:action_id].present? && params[:action_type].present? + UserAction.create(:action_id => params[:action_id], :action_type => "#{params[:action_type]}", :user_id => User.current.id, :ip => request.remote_ip) + end + render_ok + end + def watch_users watchers = Watcher.watching_users(@user.id).includes(:user).order("watchers.created_at desc") if params[:search].present? diff --git a/config/routes.rb b/config/routes.rb index 1185abd86..57fa99629 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -267,6 +267,7 @@ Rails.application.routes.draw do get :trustie_related_projects post :sync_user_info get :email_search + post :action scope '/ci', module: :ci do scope do