|
|
|
@@ -181,6 +181,17 @@ class ApplicationController < ActionController::Base |
|
|
|
tip_exception(401, "请登录后再操作") unless User.current.logged? |
|
|
|
end |
|
|
|
|
|
|
|
def require_login_cloud_ide_saas |
|
|
|
if params[:sign].present? && params[:email].present? |
|
|
|
sign = Digest::MD5.hexdigest("#{OPENKEY}#{params[:email]}") |
|
|
|
if params[:sign].to_s == sign |
|
|
|
user = User.find_by(mail: params[:email]) |
|
|
|
User.current = user |
|
|
|
end |
|
|
|
end |
|
|
|
tip_exception(401, "请登录后再操作") unless User.current.logged? |
|
|
|
end |
|
|
|
|
|
|
|
def require_profile_completed |
|
|
|
tip_exception(411, "请完善资料后再操作") unless User.current.profile_is_completed? |
|
|
|
end |
|
|
|
|