Merge branch 'standalone_develop' into pre_trustie_server

This commit is contained in:
2024-11-22 15:38:08 +08:00
11 changed files with 117 additions and 44 deletions

View File

@@ -1,10 +1,11 @@
module Accounts
class ResetPasswordService < ApplicationService
include AesCryptHelper
# login、code、password、password_confirmation
def initialize(user, params)
@user = user
@password = params[:password]
@password_confirmation = params[:password_confirmation]
@password = decrypt(params[:password]) rescue ""
@password_confirmation = decrypt(params[:password_confirmation]) rescue ""
end
def call

View File

@@ -1,5 +1,6 @@
class Api::V1::Users::UpdateEmailService < ApplicationService
include ActiveModel::Model
include AesCryptHelper
attr_reader :user, :token, :password, :mail, :old_mail, :code, :verify_code
attr_accessor :gitea_data
@@ -10,7 +11,7 @@ class Api::V1::Users::UpdateEmailService < ApplicationService
def initialize(user, params, token =nil)
@user = user
@token = token
@password = params[:password]
@password = decrypt(params[:password]) rescue ""
@mail = params[:email]
@old_mail = user.mail
@code = params[:code]

View File

@@ -1,5 +1,6 @@
class Api::V1::Users::UpdatePhoneService < ApplicationService
include ActiveModel::Model
include AesCryptHelper
attr_reader :user, :password, :phone, :code, :verify_code
@@ -8,7 +9,7 @@ class Api::V1::Users::UpdatePhoneService < ApplicationService
def initialize(user, params)
@user = user
@password = params[:password]
@password = decrypt(params[:password]) rescue ""
@phone = params[:phone]
@code = params[:code]
@verify_code = VerificationCode.where(phone: @phone, code_type: 4).last

View File

@@ -1,8 +1,10 @@
class Users::RegisterService < ApplicationService
include AesCryptHelper
def initialize(params)
@login = params[:login]
@namespace = params[:namespace]
@password = params[:password]
@password = decrypt(params[:password]) rescue ""
@code = params[:code]
end