新增:同步acge用户记录在册
This commit is contained in:
parent
6e2816af75
commit
c999d37f7e
|
@ -33,8 +33,11 @@ class Oauth::AcgeController < Oauth::BaseController
|
|||
username = uid[0..7]
|
||||
password = SecureRandom.hex(4)
|
||||
reg_result = autologin_register(username, email, password, 'acge', phone, name)
|
||||
CSV.open("public/操作系统大赛用户信息.csv", 'wb') do |csv|
|
||||
csv << [username, email, password, phone, name]
|
||||
existing_rows = CSV.read("public/操作系统大赛用户信息.csv")
|
||||
new_row = [username, email, password, phone, name]
|
||||
existing_rows << new_row
|
||||
CSV.open("public/操作系统大赛用户信息.csv", 'w') do |csv|
|
||||
existing_rows.each { |row| csv << row }
|
||||
end
|
||||
if reg_result[:message].blank?
|
||||
open_user = OpenUsers::Acge.create!(user_id: reg_result[:user][:id], uid: uid)
|
||||
|
|
Loading…
Reference in New Issue