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