Browse Source

fixed 增加自动登录

pull/313/head
xiaoxiaoqiong 4 years ago
parent
commit
ee3a14fa28
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      app/controllers/users_controller.rb

+ 3
- 3
app/controllers/users_controller.rb 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"


Loading…
Cancel
Save