
diff --git a/src/softbot/softBotDetail/index.jsx b/src/softbot/softBotDetail/index.jsx
index 73fd9690e..d1cf3ed4a 100644
--- a/src/softbot/softBotDetail/index.jsx
+++ b/src/softbot/softBotDetail/index.jsx
@@ -5,6 +5,7 @@ import { getImageUrl } from 'educoder';
import './index.scss';
import axios from "axios";
import RenderHtml from "../../components/render-html";
+import { Link } from "react-router-dom";
function SoftBotDEtail(props){
const {match:{params:{id}}, current_user, history, showLoginDialog} = props;
@@ -18,6 +19,8 @@ function SoftBotDEtail(props){
// 是否已安装此bot
const [isInstall, setIsInstall] = useState(false);
const [reload, setReload] = useState(undefined);
+ // userLoginMap: 用户白名单
+ const userLoginMap = ["wangtao", "wuxiaojun", "durian", "pxicb3wke", "xxq250", "Nigel"];
useEffect(()=>{
if(current_user && current_user.login){
@@ -26,7 +29,7 @@ function SoftBotDEtail(props){
params:{
limit: 1000,
page: 1,
- category:"manage"
+ category: userLoginMap.includes(current_user.login) ? "admin" : "manage"
}
}).then(result=>{
if(result && result.data){
@@ -84,7 +87,7 @@ function SoftBotDEtail(props){
function click(){
if(isInstall){
- props.history.push(`/settings/dispositionBot/${id}`)
+ props.history.push(`/settings/installbot/${id}`)
}else{
if(current_user && current_user.login){
// 安装此bot弹窗
@@ -134,7 +137,17 @@ function SoftBotDEtail(props){
store_list: checkValue ? selectValue.map(item=>{return item.id}) : options.map(item=>{return item.id}),
repo_map
}
- installMarketBot(params).then(res=>{
+ let bool = true;
+ // selectValue:用户选择的仓库
+ if(userLoginMap.includes(current_user.login)){
+ if(selectValue.length === 1 && selectValue[0].author.type === "Organization"){
+ params.login = selectValue[0].author.login;
+ }else{
+ message.error("请选择组织下的一个仓库");
+ bool = false;
+ }
+ }
+ bool && installMarketBot(params).then(res=>{
if(res && res.code === 200){
message.success("安装成功");
setVisible(false);
@@ -185,12 +198,13 @@ function SoftBotDEtail(props){
onChange={selectChange}
className="installSelectBox"
dropdownClassName="installDropdownClass"
+ getPopupContainer={trigger => trigger.parentNode}
>
- {filterOption.map(item=>(
{item.name}))}
+ {filterOption.map(item=>(
{`${item.author && item.author.name}/${item.name}`}))}
}
{checkValue === 1 && selectValue.map((item, index)=>{return
- {`${item.author && item.author.name}/${item.name}`}
+ {`${item.author && item.author.name}/${item.name}`}
{deleteSelect(item)}}>
})}
权限信息
diff --git a/src/softbot/softBotList/index.jsx b/src/softbot/softBotList/index.jsx
index aae273238..b1ab1423b 100644
--- a/src/softbot/softBotList/index.jsx
+++ b/src/softbot/softBotList/index.jsx
@@ -60,7 +60,7 @@ function SoftBot(props){
// 立即注册跳转
function registerBot(){
if(current_user && current_user.login){
- history.push('/settings/exploitBot/new');
+ history.push('/settings/mybot/new');
}else{
showLoginDialog();
}