@ -699,6 +699,10 @@ class User < ApplicationRecord
LimitForbidControl::UserLogin.new(self).clear
end
def from_sub_site?
laboratory_id.present? && laboratory_id != 1
protected
def validate_password_length
# 管理员的初始密码是5位
@ -43,7 +43,7 @@
<%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
<% end %>
<% if user&.from_sub_site? %>
<% if user.from_sub_site? %>
<span class="badge badge-pill badge-info">合作</span>
</td>