diff --git a/src/hooks/request/useQuestion.ts b/src/hooks/request/useQuestion.ts new file mode 100644 index 0000000..1b63b16 --- /dev/null +++ b/src/hooks/request/useQuestion.ts @@ -0,0 +1,17 @@ +import { getQuestionList } from "@/api/survey"; +import { ref } from "vue"; + +function fetchSingleQuestion(sn: string) { + const list = ref([]) + getQuestionList(sn).then(({ data }) => { + list.value = data.data; + }); + return { + list, + } +} + + +export { + fetchSingleQuestion +} \ No newline at end of file diff --git a/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue b/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue index 25eed02..3c42071 100644 --- a/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue +++ b/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue @@ -2,15 +2,15 @@ import { escapeHTML } from '@/utils/stringTranslate'; const host = `https://yiligpt.x.digitalyili.com`; -const path = '/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share'; -const param = `?token=${localStorage.getItem('plantToken')}&source=app`; +const path = '/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share?'; +const param = `token=${encodeURIComponent(localStorage.getItem('plantToken') as string)}&source=app`; const url = host + path + param; // 字符串转义