fixed 建木认证code,项目成员可见
This commit is contained in:
parent
8dba81bfca
commit
7597f1fd8f
|
@ -18,6 +18,14 @@ class MarkFilesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def mark_file_as_unread
|
||||
|
||||
end
|
||||
|
||||
def mark_file_as_read
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
def review_params
|
||||
params.require(:review).permit(:content, :commit_id, :status)
|
||||
|
|
|
@ -114,11 +114,13 @@ module ProjectsHelper
|
|||
# API:
|
||||
# GET:https://ci-v3.test.jianmuhub.com/oauth2/authorize?code=${encode(密文)}
|
||||
def jianmu_devops_code(project, user)
|
||||
data = { userId: user.id, ref: project.identifier, owner: project.owner.login, timestamp: Time.now.to_i * 1000 }
|
||||
uid = EduSetting.get("jianmu_oauth2_uid") || 'oedKx4v-WyAfu2oy_AsFpFQCH_-g91ms0PQKN7YcEuw'
|
||||
app = Doorkeeper::Application.find_by(uid: uid)
|
||||
key = 'bf3c199c2470cb477d907b1e0917c17b'
|
||||
aes_encrypt(key, data.to_json)
|
||||
if user.admin? || project.member?(user.id)
|
||||
data = { userId: user.id, ref: project.identifier, owner: project.owner.login, timestamp: Time.now.to_i * 1000 }
|
||||
# uid = EduSetting.get("jianmu_oauth2_uid") || 'oedKx4v-WyAfu2oy_AsFpFQCH_-g91ms0PQKN7YcEuw'
|
||||
# app = Doorkeeper::Application.find_by(uid: uid)
|
||||
key = 'bf3c199c2470cb477d907b1e0917c17b'
|
||||
aes_encrypt(key, data.to_json)
|
||||
end
|
||||
end
|
||||
|
||||
def aes_encrypt(key, des_text)
|
||||
|
|
Loading…
Reference in New Issue