fixed bot安装仓库列表必须使用access_tokens获取到bot的token才能查询

This commit is contained in:
2023-04-04 17:38:48 +08:00
parent 04c30be5a6
commit 80fa5330b2
3 changed files with 71 additions and 25 deletions

View File

@@ -18,7 +18,10 @@ class InstallationsController < ApplicationController
def repositories
# 与github差异所以取安装用户和bot对应所有的仓库
@install_bots = BotInstall.where(bot_id: get_bot_id).where(installer_id: params[:id])
# 必须使用access_tokens获取到bot的token才能查询
tip_exception "Token无效" if current_user.platform != "bot"
bot = Bot.find_by(uid: current_user.id)
@install_bots = BotInstall.where(bot_id: bot.id).where(installer_id: params[:id])
end
def update_secret