|
@@ -1043,17 +1043,38 @@ export default {
|
|
|
});
|
|
|
} else if (item.label == "agent") {//复制智能体
|
|
|
console.log("复制智能体")
|
|
|
- let _idList = [id];
|
|
|
- this.ajax.post('https://appapi.cocorobo.cn/api/agents/copy_agent',{
|
|
|
- ids: _idList,
|
|
|
- userId: this.userId,
|
|
|
- username: this.userName?this.userName:await this.getUserName(this.userId),
|
|
|
- }).then(_=>{
|
|
|
- resolve(2);
|
|
|
+ this.ajax.get(`https://appapi.cocorobo.cn/api/agents/agent/parent/${id}`).then(async res=>{
|
|
|
+ let _id = res.data.id;
|
|
|
+ if(_id){
|
|
|
+ let _idList = [_id];
|
|
|
+ this.ajax.post('https://appapi.cocorobo.cn/api/agents/copy_agent',{
|
|
|
+ ids: _idList,
|
|
|
+ userId: this.userId,
|
|
|
+ username: this.userName?this.userName:await this.getUserName(this.userId),
|
|
|
+ }).then(_=>{
|
|
|
+ resolve(2);
|
|
|
+ }).catch(e=>{
|
|
|
+ console.log(e)
|
|
|
+ resolve(0)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(res)
|
|
|
}).catch(e=>{
|
|
|
- console.log(e)
|
|
|
+ console.log(e);
|
|
|
resolve(0)
|
|
|
+ // this.$message.error("")
|
|
|
})
|
|
|
+ // let _idList = [id];
|
|
|
+ // this.ajax.post('https://appapi.cocorobo.cn/api/agents/copy_agent',{
|
|
|
+ // ids: _idList,
|
|
|
+ // userId: this.userId,
|
|
|
+ // username: this.userName?this.userName:await this.getUserName(this.userId),
|
|
|
+ // }).then(_=>{
|
|
|
+ // resolve(2);
|
|
|
+ // }).catch(e=>{
|
|
|
+ // console.log(e)
|
|
|
+ // resolve(0)
|
|
|
+ // })
|
|
|
}
|
|
|
});
|
|
|
},
|