refactor: standardize import paths and clean up unused code
Migrate legacy relative API imports to consistent absolute @/api paths across all components Remove unnecessary .js file extensions from ES module imports Add new StreamManager utility and base client configuration constants file Clean up unused imports and dynamic config calls in ChatGuide and ChatInputArea components Update the index.html page title to "nianxx" Replace dynamic OSS URL and local text imports in ChatGuide with hardcoded static values
This commit is contained in:
@@ -32,8 +32,8 @@
|
||||
import { defineProps, computed, watch, onBeforeUnmount } from "vue";
|
||||
|
||||
import ChatMarkdown from "../ChatMarkdown/index.vue";
|
||||
import ChatLoading from "./ChatLoading/index.vue";
|
||||
import StreamManager from '@/utils/StreamManager.js';
|
||||
import ChatLoading from "../ChatLoading/index.vue";
|
||||
import StreamManager from '@/utils/StreamManager';
|
||||
import {
|
||||
getLongTextPredivText,
|
||||
getLongTextValue,
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ossChengduUrl } from "@/request/base/baseUrl";
|
||||
import { chatGuideSubTitle } from "@/constant/local";
|
||||
|
||||
const props = defineProps({
|
||||
hasMessage: {
|
||||
@@ -27,7 +25,7 @@ const props = defineProps({
|
||||
// 图片路径
|
||||
imageSrc: {
|
||||
type: String,
|
||||
default: `${ossChengduUrl()}come_chat_image.png`
|
||||
default: `https://one-feel-config-images-bucket.oss-cn-chengdu.aliyuncs.com/XIAOQI/come_chat_image.png`
|
||||
},
|
||||
// 主标题
|
||||
mainTitle: {
|
||||
@@ -37,7 +35,7 @@ const props = defineProps({
|
||||
// 副标题
|
||||
subTitle: {
|
||||
type: String,
|
||||
default: chatGuideSubTitle()
|
||||
default: '点击开始聊天'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -61,19 +61,14 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch, nextTick, onMounted, defineExpose, onUnmounted } from "vue";
|
||||
import RecordingWaveBtn from "@/components/Speech/RecordingWaveBtn.vue";
|
||||
import { chatInputPlaceholder } from "@/constant/local";
|
||||
// #ifdef APP-PLUS
|
||||
import { appSpeechRecognitionOptions } from "@/constant/speech";
|
||||
// #endif
|
||||
|
||||
|
||||
let manager = null;
|
||||
let speechProvider = "";
|
||||
const isSpeechRecognitionEnabled = ref(true);
|
||||
const isSpeechRecognitionSupported = ref(false);
|
||||
let appSpeechOptions = {};
|
||||
// #ifdef APP-PLUS
|
||||
appSpeechOptions = appSpeechRecognitionOptions;
|
||||
// #endif
|
||||
|
||||
|
||||
// WechatSI 是微信小程序插件,App 原生基座没有 requirePlugin。
|
||||
// #ifdef MP-WEIXIN
|
||||
@@ -109,9 +104,7 @@ const recordingWaveBtnRef = ref(null);
|
||||
const appSpeechRef = ref(null);
|
||||
const appSpeechKey = ref(0);
|
||||
const appSpeechVisible = ref(true);
|
||||
const placeholder = computed(() => {
|
||||
return chatInputPlaceholder();
|
||||
});
|
||||
const placeholder = ref('请输入');
|
||||
const inputMessage = ref(props.modelValue || "");
|
||||
const isFocused = ref(false);
|
||||
const keyboardHeight = ref(0);
|
||||
|
||||
@@ -39,7 +39,7 @@ import TopNavBar from "@/components/TopNavBar/index.vue";
|
||||
import ChatMarkdown from "../ChatMarkdown/index.vue";
|
||||
import ParsedValuediv from "./ParsedValuediv.vue";
|
||||
import { defineProps, ref, nextTick, computed } from "vue";
|
||||
import StreamManager from "@/utils/StreamManager.js";
|
||||
import StreamManager from "@/utils/StreamManager";
|
||||
import {
|
||||
LONG_TEXT_KEYS,
|
||||
getLongTextSections,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { Command } from "@/model/ChatModel";
|
||||
import { Command } from "@/constants/ChatModel";
|
||||
import { SEND_MESSAGE_COMMAND_TYPE } from "@/constants/constant";
|
||||
import { checkToken } from "@/hooks/useGoLogin";
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ import CardSwiper from "./components/CardSwiper/index.vue";
|
||||
import QuickQuestions from "./components/QuickQuestions/index.vue";
|
||||
import discoveryCover from "@/components/ImageSwiper/images/2025-07-12_180248.jpg";
|
||||
|
||||
import { homeTabsData, getNearbyTags, homeTabContentData, homeQuickQuestionData } from "../../request/api/MainPageDataApi";
|
||||
import { homeTabsData, getNearbyTags, homeTabContentData, homeQuickQuestionData } from "@/api/home";
|
||||
import { useAppStore, useLocationStore } from "@/store";
|
||||
import { JumpType } from "../../model/ChatModel";
|
||||
import { JumpType } from "@/constants/ChatModel";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const locationStore = useLocationStore();
|
||||
|
||||
Reference in New Issue
Block a user