|
|
|
@ -1693,6 +1693,11 @@ class User < Principal
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def self.create_with_ecoder!(info)
|
|
|
|
|
user = User.find_by_phone(info["mobile"])
|
|
|
|
|
|
|
|
|
|
# 如果手机号存在,则直接绑定用户
|
|
|
|
|
# 因为手机号可以取回密码,所以可以视为同一用户
|
|
|
|
|
unless user
|
|
|
|
|
user = User.new
|
|
|
|
|
user.admin = false
|
|
|
|
|
user.login = "ecoder_" + info["mobile"]
|
|
|
|
@ -1718,6 +1723,7 @@ class User < Principal
|
|
|
|
|
ue = user.user_extensions ||= UserExtensions.new
|
|
|
|
|
ue.user_id = user.id
|
|
|
|
|
ue.save!
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
user
|
|
|
|
|
end
|
|
|
|
|