Merge branch 'develop' into standalone_develop

This commit is contained in:
2023-05-30 11:13:09 +08:00
4 changed files with 12 additions and 3 deletions

View File

@@ -759,10 +759,11 @@ class UsersController < ApplicationController
password = "12345678"
# 没有用户时,新建用户并登录
user = User.where("login = ? or phone = ? or mail = ? ", "#{login}", phone, email).first
user = phone.present? ? User.find_by(phone: phone) : nil
user = User.where("login = ? or phone = ? or mail = ? ", "#{login}", phone, email).first if user.nil?
if user.present?
# 手机号先记录,后续用
user.update_column(:phone, "#{phone}") if phone.present?
user.update_column(:phone, "#{phone}") if phone.present? && user.phone.blank?
else
ActiveRecord::Base.transaction do
email = "#{login}@gitlink.org.cn" if email.blank?