Merge branch 'standalone_develop' into pre_trustie_server
This commit is contained in:
commit
0ccd6790c3
|
@ -8,6 +8,11 @@ class Api::V1::UsersController < Api::V1::BaseController
|
|||
render_ok
|
||||
end
|
||||
|
||||
def check_user_login
|
||||
return tip_exception(-1, "用户标识不存在") unless params[:login].present? && User.exists?(login: params[:login])
|
||||
render_ok
|
||||
end
|
||||
|
||||
def send_email_vefify_code
|
||||
code = %W(0 1 2 3 4 5 6 7 8 9)
|
||||
verification_code = code.sample(6).join
|
||||
|
|
|
@ -29,3 +29,4 @@ json.has_trace_user @user.trace_user.present?
|
|||
json.is_new @user.login.present? && params[:login].to_s.include?("#{@user.login}")
|
||||
json.nps EduSetting.get("nps-on-off-switch").to_s == 'true' && UserNp.where(user_id: current_user.id).where("created_at >= ?", (Time.now - 30.days).beginning_of_day ).blank?
|
||||
json.open_blockchain EduSetting.get("open_blockchain_users").to_s.split(",").include?(@user.id.to_s) || EduSetting.get("open_blockchain_users").to_s.split(",").include?(@user.login)
|
||||
json.sign_cla @user.sign_cla
|
||||
|
|
|
@ -5,6 +5,7 @@ defaults format: :json do
|
|||
resources :users, only: [:index] do
|
||||
collection do
|
||||
post :check_user_id
|
||||
post :check_user_login
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddSignClaToUsers < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :users, :sign_cla, :boolean, default: false
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue