pre_develop
daiao 6 years ago
parent b1263a1cd0
commit b252983b7d

@ -31,7 +31,6 @@ module Mobile
desc "创建用户" desc "创建用户"
params do params do
requires :userName, type: String, desc: "好大学用户名" requires :userName, type: String, desc: "好大学用户名"
optional :name, type: String, desc: "用户姓名"
end end
post "create_user" do post "create_user" do
CnmoocsService.new.create_user params CnmoocsService.new.create_user params

@ -79,11 +79,12 @@ class CnmoocsService
mail = params[:email] || c_user.generate_email mail = params[:email] || c_user.generate_email
name = params[:name] || "好大学_#{params[:userName]}" name = params[:name] || "好大学_#{params[:userName]}"
login = generate_login('m')
create_params = { create_params = {
lastname: name, lastname: name,
mail: mail, mail: mail,
mail_notification: mail, mail_notification: mail,
login: generate_login('m'), login: login,
password: OauthController::DEFAULT_PASSWORD, password: OauthController::DEFAULT_PASSWORD,
certification: 1 certification: 1
} }

Loading…
Cancel
Save