mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-19 03:05:57 +08:00
fixed 密码处理,兼容base64
This commit is contained in:
@@ -54,7 +54,7 @@ class Api::V1::UsersController < Api::V1::BaseController
|
||||
end
|
||||
|
||||
def check_password
|
||||
password = decrypt(params[:password]) rescue ""
|
||||
password = decrypt(params[:password]) rescue params[:password].to_s
|
||||
return tip_exception(-5, "8~16位密码,支持字母数字和符号") unless password =~ CustomRegexp::PASSWORD
|
||||
return tip_exception(-5, "密码错误") unless @observe_user.check_password?(password)
|
||||
render_ok
|
||||
@@ -127,7 +127,7 @@ class Api::V1::UsersController < Api::V1::BaseController
|
||||
|
||||
|
||||
def destroy
|
||||
password = decrypt(params[:password]) rescue ""
|
||||
password = decrypt(params[:password]) rescue params[:password].to_s
|
||||
return tip_exception(-1, "密码不正确.") unless @observe_user.check_password?(password)
|
||||
org_ids = TeamUser.where(user_id: @observe_user.id).pluck(:organization_id) | OrganizationUser.where(user_id: @observe_user.id).pluck(:organization_id)
|
||||
org_count = TeamUser.where(organization_id: org_ids).where(user_id: @observe_user.id).joins(:team).where(teams: {authorize: %w(owner)}).count
|
||||
|
||||
Reference in New Issue
Block a user