feat: projectID设置
This commit is contained in:
@@ -13,8 +13,13 @@ export const useProjectStore = defineStore('project', () => {
|
||||
}
|
||||
}
|
||||
|
||||
const setId = id=>{
|
||||
state.value.id = id
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
setProject,
|
||||
setId
|
||||
}
|
||||
})
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
import Input from '../../components/Input.vue'
|
||||
import { fetchAgentReply } from '@/api/agent'
|
||||
import type { AgentParamsType } from '@/api/agent'
|
||||
import { useUserInfoStore } from '@/stores'
|
||||
import { useUserInfoStore,useProjectStore } from '@/stores'
|
||||
import { useAgentStore } from '@/stores/agent'
|
||||
|
||||
const userStore = useUserInfoStore()
|
||||
const agentStore = useAgentStore()
|
||||
|
||||
const projectStore = useProjectStore()
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
title: string
|
||||
@@ -38,7 +38,7 @@
|
||||
const messageList = ref([])
|
||||
const listRef = ref()
|
||||
const params = reactive<AgentParamsType>({
|
||||
projectID: '',
|
||||
projectID: '1',
|
||||
message: '',
|
||||
token: userStore.state.token,
|
||||
versionID: '',
|
||||
@@ -59,6 +59,7 @@
|
||||
|
||||
onMounted(() => {
|
||||
// 检查 store 中是否有初始项目数据
|
||||
projectStore.setId('1') // 临时设置项目ID为1,实际应用中应根据上下文动态设置
|
||||
const initialData = agentStore.getInitialProjectData
|
||||
if (initialData) {
|
||||
// 等待页面渲染完成后自动发送初始消息
|
||||
|
||||
Reference in New Issue
Block a user