codepedia邮箱为空时报错

dev_aliyun
daiao 5 years ago
parent 254af9cfc1
commit 4d19ea1fde

@ -171,7 +171,8 @@ class SourcesService
def get_user_info params
user = User.find params[:id]
{username: user.show_real_name, user_id: user.id, email: user.mail, phone: user.phone, sex: user.sex, school_name: user.school_name}
mail = user.mail.presence || "login@educoder.net"
{username: user.show_real_name, user_id: user.id, email: mail, phone: user.phone, sex: user.sex, school_name: user.school_name}
end
# courses start ############################################

Loading…
Cancel
Save