refactor: fix routing, update APIs and clean up miscellaneous code

- add mitt-based event emitter utility in src/utils/events.ts
- replace deprecated navigateTo calls with vue router push across multiple components
- fix incorrect API function name (updateImageFile → uploadFile) in CreateServiceOrder
- correct typo in imported function name in AnswerComponent
- temporarily disable location fetch logic in Discovery page
- update external link token handling in LongTextGuideCardPreview
This commit is contained in:
DEV_DSW
2026-05-27 08:55:37 +08:00
parent fbc5137d17
commit 9282b2a9c5
8 changed files with 42 additions and 24 deletions

View File

@@ -73,7 +73,7 @@
import { ref, computed, onMounted, nextTick, defineProps, watch } from "vue";
import { SCROLL_TO_BOTTOM } from "@/constants/constant";
import { createWorkOrder } from "@/api/workOrder";
import { updateImageFile } from "@/api/upload";
import { uploadFile } from "@/api/upload";
import { zniconsMap } from "@/assets/fonts/znicons";
const props = defineProps({
@@ -148,7 +148,7 @@ const updateImagehandle = (file) => {
if (!file) {
return;
}
updateImageFile(file).then((res) => {
uploadFile(file).then((res) => {
contentImgUrl.value = res.data;
});
};

View File

@@ -21,7 +21,7 @@
<script setup>
import { getAccessToken } from "@/constants/token";
import { defineProps, computed } from "vue";
import { navigateTo } from "../../router";
// import { navigateTo } from "../../router";
const props = defineProps({
toolCall: {
@@ -40,7 +40,12 @@ const surveyData = computed(() => {
const handleCall = () => {
const token = getAccessToken();
navigateTo(surveyData.value.jumpUrl, { token: token });
router.push({
path: surveyData.value.jumpUrl,
query: {
token: token,
},
});
};
</script>