diff --git a/app/services/cnmoocs_service.rb b/app/services/cnmoocs_service.rb index 4c287455..d231ceae 100644 --- a/app/services/cnmoocs_service.rb +++ b/app/services/cnmoocs_service.rb @@ -85,12 +85,14 @@ class CnmoocsService lastname: name, mail: mail, mail_notification: mail, - login: login, password: OauthController::DEFAULT_PASSWORD, certification: 1 } ActiveRecord::Base.transaction do - user = User.create!(create_params) + user = User.new(create_params) + # login 有问题,只能这样赋值 + user.login = login + user.save! UserExtensions.create!(user_id: user.id, school_id: School.first.id, identity: 4, gender: 0)