|
|
|
@@ -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) |
|
|
|
|