feat:历史记录关于user_id限制
This commit is contained in:
@@ -15,6 +15,12 @@ const agentsStore = useAgentsStore()
|
||||
|
||||
// 如果agentsStore.agents不存在就读取默认配置的json文件
|
||||
onMounted(async () => {
|
||||
// 先调用 getAgents,检查是否需要生成 user_id
|
||||
const res = await api.getAgents()
|
||||
if (res && res.user_id) {
|
||||
console.log('[AgentRepo] 获取到 user_id:', res.user_id)
|
||||
}
|
||||
|
||||
if (!agentsStore.agents.length) {
|
||||
const res = await readConfig<Agent[]>('agent.json')
|
||||
agentsStore.setAgents(res)
|
||||
|
||||
@@ -115,9 +115,10 @@ const historyUpdatedHandler = () => {
|
||||
const fetchPlans = async () => {
|
||||
loading.value = true
|
||||
const reqId = generateRequestId()
|
||||
const userId = localStorage.getItem('user_id')
|
||||
|
||||
try {
|
||||
const result = await websocket.send('get_plans', { id: reqId })
|
||||
const result = await websocket.send('get_plans', { id: reqId, user_id: userId })
|
||||
plans.value = (result.data || []) as PlanInfo[]
|
||||
} catch (error) {
|
||||
console.error('获取任务列表失败:', error)
|
||||
|
||||
Reference in New Issue
Block a user