Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_home
cxt 5 years ago
commit 5c8c79222c

@ -695,6 +695,10 @@ class User < ApplicationRecord
LimitForbidControl::UserLogin.new(self).clear
end
def from_sub_site?
laboratory_id.present? && laboratory_id != 1
end
protected
def validate_password_length
# 管理员的初始密码是5位

@ -177,7 +177,7 @@ class Subjects::CopySubjectService < ApplicationService
def copy_challenge_questions_data!(challenge_choose, to_challenge_choose)
challenge_choose.challenge_questions.each do |challenge_question|
to_challenge_question = to_challenge_choose.challenge_questions.new
to_challenge_question.attributes = challenge_question.attributes.dup.except('id,', 'challenge_choose_id')
to_challenge_question.attributes = challenge_question.attributes.dup.except('id', 'challenge_choose_id')
to_challenge_question.challenge_choose_id = to_challenge_choose.id
to_challenge_question.save!
end

@ -43,6 +43,9 @@
<%= 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? %>
<span class="badge badge-pill badge-info">合作</span>
<% end %>
</td>
<td><%= user.real_name %></td>
<td><%= user.ID_number %></td>

@ -41,6 +41,9 @@
<%= link_to "/users/#{user.login}", class: 'professional-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? %>
<span class="badge badge-pill badge-info">合作</span>
<% end %>
</td>
<td><%= user.real_name %></td>
<td><%= raw [user.school_name.presence, user.department_name.presence].compact.join('<br/>') %></td>

@ -604,7 +604,7 @@ class LoginDialog extends Component {
setNotcompleteds={()=>{this.setNotcompleteds()}}
/>
{this.state.isphone===false?<style>
{this.state.isphone===false||this.props.user&&this.props.user.main_site===false?<style>
{
`
#DialogID .dialogBox {

Loading…
Cancel
Save