更改:csv写入模式

This commit is contained in:
yystopf 2024-03-21 17:38:57 +08:00
parent c999d37f7e
commit 68348f1fc3
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class Oauth::AcgeController < Oauth::BaseController
existing_rows = CSV.read("public/操作系统大赛用户信息.csv")
new_row = [username, email, password, phone, name]
existing_rows << new_row
CSV.open("public/操作系统大赛用户信息.csv", 'w') do |csv|
CSV.open("public/操作系统大赛用户信息.csv", 'wb') do |csv|
existing_rows.each { |row| csv << row }
end
if reg_result[:message].blank?