forked from Gitlink/forgeplus
Merge branch 'develop' into dev_trustie_server
This commit is contained in:
commit
36fb5a118c
|
@ -28,7 +28,7 @@ class ApplicationController < ActionController::Base
|
||||||
DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
|
DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
|
||||||
OPENKEY = "79e33abd4b6588941ab7622aed1e67e8"
|
OPENKEY = "79e33abd4b6588941ab7622aed1e67e8"
|
||||||
|
|
||||||
helper_method :current_user
|
helper_method :current_user, :base_url
|
||||||
|
|
||||||
# 所有请求必须合法签名
|
# 所有请求必须合法签名
|
||||||
def check_sign
|
def check_sign
|
||||||
|
@ -769,6 +769,11 @@ class ApplicationController < ActionController::Base
|
||||||
@repository ||= load_project&.repository
|
@repository ||= load_project&.repository
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def base_url
|
||||||
|
request.base_url
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
def object_not_found
|
def object_not_found
|
||||||
uid_logger("Missing template or cant't find record, responding with 404")
|
uid_logger("Missing template or cant't find record, responding with 404")
|
||||||
|
|
|
@ -5,12 +5,16 @@ json.location @user.location
|
||||||
json.image_url url_to_avatar(@user)
|
json.image_url url_to_avatar(@user)
|
||||||
json.url "#{request.base_url }/users/#{@user.login}"
|
json.url "#{request.base_url }/users/#{@user.login}"
|
||||||
json.followers_count @user.followers_count
|
json.followers_count @user.followers_count
|
||||||
|
json.followers_url "#{base_url}/users/#{@user.login}/fan_users"
|
||||||
json.following_count @user.following_count
|
json.following_count @user.following_count
|
||||||
|
json.following_url "#{base_url}/users/#{@user.login}/watchers"
|
||||||
|
json.projects_count @user.projects_count
|
||||||
|
json.projects_url "#{base_url}/users/#{@user.login}"
|
||||||
json.projects_count @user.projects_count
|
json.projects_count @user.projects_count
|
||||||
json.is_watch current_user&.watched?(@user)
|
json.is_watch current_user&.watched?(@user)
|
||||||
json.organizations @user.organizations do |organization|
|
json.organizations @user.organizations do |organization|
|
||||||
json.login organization.login
|
json.login organization.login
|
||||||
json.name organization.real_name
|
json.name organization.real_name
|
||||||
json.image_url url_to_avatar(organization)
|
json.image_url url_to_avatar(organization)
|
||||||
json.url "#{request.base_url }/organize/#{organization.login}"
|
json.url "#{base_url}/organize/#{organization.login}"
|
||||||
end
|
end
|
Loading…
Reference in New Issue