mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 12:45:46 +08:00
新增:更改邮箱相关接口文档
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
class Api::V1::Users::UpdateEmailService < ApplicationService
|
||||
include ActiveModel::Model
|
||||
|
||||
attr_reader :user, :token, :password, :mail, :old_mail, :code, :code_type, :verify_code
|
||||
attr_reader :user, :token, :password, :mail, :old_mail, :code, :verify_code
|
||||
attr_accessor :gitea_data
|
||||
|
||||
validates :password, :code, :code_type, presence: true
|
||||
validates :password, :code, presence: true
|
||||
validates :mail, presence: true, format: { with: CustomRegexp::EMAIL }
|
||||
|
||||
def initialize(user, params, token =nil)
|
||||
@@ -14,8 +14,7 @@ class Api::V1::Users::UpdateEmailService < ApplicationService
|
||||
@mail = params[:email]
|
||||
@old_mail = user.mail
|
||||
@code = params[:code]
|
||||
@code_type = params[:code_type]
|
||||
@verify_code = VerificationCode.where(email: @mail, code: @code, code_type: @code_type).last
|
||||
@verify_code = VerificationCode.where(email: @mail, code: @code, code_type: 10).last
|
||||
end
|
||||
|
||||
def call
|
||||
|
||||
Reference in New Issue
Block a user