FIX 主动同步头歌账号到gitea平台,防止前端进行弹框

This commit is contained in:
jasder duan 2024-12-06 16:25:33 +08:00
parent c7d99d14f8
commit 1c6357b9ce
2 changed files with 5 additions and 5 deletions

View File

@ -310,7 +310,7 @@ class ApplicationController < ActionController::Base
create_gitea_user!(current_user, current_user.login, email, 'zq123456')
rescue => e
Rails.logger.info "@@主动检测并同步gitea账号错误: #{e.message}"
next
return
end
end
end

View File

@ -759,6 +759,10 @@ class User < Owner
laboratory_id.present? && laboratory_id != 1
end
def has_gitea_user?
self.gitea_token.present? && self.gitea_uid.present?
end
protected
def validate_password_length
# 管理员的初始密码是5位
@ -785,10 +789,6 @@ class User < Owner
def set_lastname
self.lastname = self.nickname if changes[:nickname].present?
end
def has_gitea_user?
self.gitea_token.present? && self.gitea_uid.present?
end
end