This commit is contained in:
sylor_huang@126.com 2020-08-11 15:23:49 +08:00
parent c7a89d1660
commit d6ef3d8aa3
3 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@ module LoginHelper
end
def autologin_cookie_name
edu_setting('autologin_cookie_name').presence || 'autologin_forge_military'
edu_setting('autologin_cookie_name').presence || 'autologin'
end
def set_autologin_cookie(user)

View File

@ -140,8 +140,9 @@ class UsersController < ApplicationController
# 其他平台登录后必须将token同步到forge平台实现sso登录功能
def sync_token
return render_error('未找相关用户!') unless @user
return render_error('缺少参数!') unless params[:type]
token = Token.get_or_create_permanent_login_token(@user, 'autologin')
token = Token.get_or_create_permanent_login_token(@user, params[:type])
token.update_column(:value, params[:token])
render_ok
end

View File

@ -675,7 +675,7 @@ class User < ApplicationRecord
end
def autologin_name
EduSetting.get('autologin_cookie_name') || "autologin_forge_military"
EduSetting.get('autologin_cookie_name') || "autologin"
end
def set_laboratory