fixed 增加自动登录

This commit is contained in:
xiaoxiaoqiong 2022-05-24 10:34:31 +08:00
parent 26bfc2c0bf
commit ee3a14fa28
1 changed files with 3 additions and 3 deletions

View File

@ -332,10 +332,10 @@ class UsersController < ApplicationController
def sso_login
if params[:login].present? && !current_user.logged? && params[:websiteName].present?
params = { "login" => "#{params[:login]}", "private_token" => "hriEn3UwXfJs3PmyXnSH" }
api_url= "https://pre-data.educoder.net"
req_params = { "login" => "#{params[:login]}", "private_token" => "hriEn3UwXfJs3PmyXnSH" }
api_url= "https://data.educoder.net"
client = Faraday.new(url: api_url)
response = client.public_send("get", "/api/sources/get_user_info_by_login", params)
response = client.public_send("get", "/api/sources/get_user_info_by_login", req_params)
result = JSON.parse(response.body)
if result["status"].to_s == "0"