diff --git a/app/api/mobile/apis/cnmooc.rb b/app/api/mobile/apis/cnmooc.rb index 026581cd..1f37af91 100644 --- a/app/api/mobile/apis/cnmooc.rb +++ b/app/api/mobile/apis/cnmooc.rb @@ -31,7 +31,6 @@ module Mobile desc "创建用户" params do requires :userName, type: String, desc: "好大学用户名" - optional :name, type: String, desc: "用户姓名" end post "create_user" do CnmoocsService.new.create_user params diff --git a/app/services/cnmoocs_service.rb b/app/services/cnmoocs_service.rb index a7605110..52514a67 100644 --- a/app/services/cnmoocs_service.rb +++ b/app/services/cnmoocs_service.rb @@ -79,11 +79,12 @@ class CnmoocsService mail = params[:email] || c_user.generate_email name = params[:name] || "好大学_#{params[:userName]}" + login = generate_login('m') create_params = { lastname: name, mail: mail, mail_notification: mail, - login: generate_login('m'), + login: login, password: OauthController::DEFAULT_PASSWORD, certification: 1 }