From adfd4693234cae07b81629b1d8d795162ad0a657 Mon Sep 17 00:00:00 2001 From: martsi Date: Fri, 19 Jul 2024 20:34:28 +0800 Subject: [PATCH] feat(fetchSimpleJob/fetchLevelJob) --- src/api/job.ts | 10 +++++++++- src/store/job.ts | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/api/job.ts b/src/api/job.ts index 9ad7d97..dfb8eee 100644 --- a/src/api/job.ts +++ b/src/api/job.ts @@ -18,7 +18,15 @@ const axiosInstance = createAxiosInstance(axiosConfig); * 获取 Job * @param data */ -export function fetchJob(data: string) { +export function fetchSimpleJob(data: string) { + return axiosInstance.post("/gis_agent_backend/simple/task_plan/", data, { + headers: { + "Content-Type": "application/json", + }, + }); +} + +export function fetchLevelJob(data: string) { return axiosInstance.post( "/gis_agent_backend/plan2level/task_plan/?modelName=gpt-4o", data, diff --git a/src/store/job.ts b/src/store/job.ts index 0f07a0c..dddde21 100644 --- a/src/store/job.ts +++ b/src/store/job.ts @@ -1,15 +1,15 @@ import { defineStore } from "pinia"; import { job2G6TreeGraph, jobLeafNode2G6Graph } from "@/utils/graphUtil.ts"; import { computed } from "vue"; -import { fetchJob } from "@/api"; +import { fetchSimpleJob } from "@/api"; import { Task } from "@/type.ts"; export const useJobStore = defineStore("job", () => { let _job: Task; async function updateData(question: string) { - // const res = (await fetchJob(question)).data; - const res = (await fetchJob(`{ "task": "${question}" }`)).data; + const res = (await fetchSimpleJob(`{ "task": "${question}" }`)).data; + // const res = (await fetchLevelJob(`{ "task": "${question}" }`)).data; console.debug("res", res); _job = convertData(res.data);