接口调整

dev_forum
cxt 6 years ago
parent 155152acb1
commit ac5d8f627f

@ -35,7 +35,7 @@ class AccountsController < ApplicationController
# todo 上线前请删除万能验证码"513231"
if code != "513231"
tip_exception(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
tip_exception(-2, "验证码已失效") if (Time.now.to_i - verifi_code.created_at.to_i) > 10*60
tip_exception(-2, "验证码已失效") if !verifi_code&.effective?
end
code = generate_identifier User, 8
@ -91,7 +91,7 @@ class AccountsController < ApplicationController
user = User.find_by_mail(email) #这里有问题应该是为email,而不是mail 6.13-hs
end
tip_exception(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
tip_exception(-2, "验证码已失效") if (Time.now.to_i - verifi_code.created_at.to_i) > 10*60
tip_exception(-2, "验证码已失效") if !verifi_code&.effective?
user.password, user.password_confirmation = params[:new_password], params[:new_password_confirmation]
if user.save!

@ -1,5 +1,5 @@
json.id @user.id
json.name @user.homepage_name
json.name @user.full_name
json.avatar_url url_to_avatar(@user)
json.is_logged_user @user.logged_user?
json.experience @user.experience

Loading…
Cancel
Save