fix: 修复智能生成问卷 iframe 适配问题

- 更新 iframe src 属性的拼接方式,使用 encodeURIComponent 对 token 进行编码
- 移除 encodeURI 函数的使用,直接使用拼接好的 url
This commit is contained in:
Huangzhe
2025-05-26 14:17:17 +08:00
parent 0a91df64b5
commit f886a51110
2 changed files with 3 additions and 4 deletions

View File

@@ -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;
// 字符串转义
</script>
<template>
<iframe style="height: 100%; width: 100%" :src="encodeURI(url)" frameborder="0" />
<iframe style="height: 100%; width: 100%" :src="url" frameborder="0" />
</template>
<style scoped lang="scss"></style>

View File

@@ -105,7 +105,6 @@ function clearSurveys() {
async function validateSurvey(survey: SurveyItem): Promise<boolean> {
const { data } = await getQuestionList(survey.sn);
const questions = data.data.questions;
return
return questions.every((question: any) => {
if (!questionTypeMap.has(question.question_type)) {
return false;