|
|
|
@ -61,7 +61,6 @@ class AccountsController < ApplicationController
|
|
|
|
|
ua.update_column(:agent_type, UserAgent::USER_REGISTER) if ua
|
|
|
|
|
successful_authentication(@user)
|
|
|
|
|
# session[:user_id] = @user.id
|
|
|
|
|
session[:"#{default_yun_session}"] = @user.id
|
|
|
|
|
normal_status("注册成功")
|
|
|
|
|
end
|
|
|
|
|
rescue Exception => e
|
|
|
|
@ -137,6 +136,7 @@ class AccountsController < ApplicationController
|
|
|
|
|
set_autologin_cookie(user)
|
|
|
|
|
UserAction.create(:action_id => user.try(:id), :action_type => "Login", :user_id => user.try(:id), :ip => request.remote_ip)
|
|
|
|
|
user.update_column(:last_login_on, Time.now)
|
|
|
|
|
session[:"#{default_yun_session}"] = user.id
|
|
|
|
|
# 注册完成后有一天的试用申请(先去掉)
|
|
|
|
|
# UserDayCertification.create(user_id: user.id, status: 1)
|
|
|
|
|
end
|
|
|
|
@ -159,7 +159,6 @@ class AccountsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
def logout
|
|
|
|
|
UserAction.create(action_id: User.current.id, action_type: "Logout", user_id: User.current.id, :ip => request.remote_ip)
|
|
|
|
|
session[:"#{default_yun_session}"] = nil
|
|
|
|
|
logout_user
|
|
|
|
|
render :json => {status: 1, message: "退出成功!"}
|
|
|
|
|
end
|
|
|
|
|