fix: update package.json dependencies and refactor share composables for improved functionality

This commit is contained in:
keven1024
2025-06-03 14:30:41 +08:00
parent 3eee404868
commit edf0fe471d
8 changed files with 25 additions and 25 deletions

View File

@@ -5,14 +5,15 @@ import { Input } from "@/components/ui/input";
import { useClipboard } from "@vueuse/core";
import { toast } from "vue-sonner";
import { useQuery } from "@tanstack/vue-query";
import useAppShare from "@/composables/useShare";
import useMyAppShare from "~/composables/useMyAppShare";
import useMyAppConfig from "@/composables/useMyAppConfig";
const props = defineProps<{
data: { file: File; config: any; handle_type: string; file_id: string };
}>();
const emit = defineEmits<{
(e: "change", key: string): void;
}>();
const { createFileShare } = useAppShare();
const { createFileShare } = useMyAppShare();
const { data } = useQuery({
queryKey: ["create-share", props?.data?.file_id],
queryFn: async () => {
@@ -27,7 +28,7 @@ const { data } = useQuery({
},
});
const appConfig = useAppConfig();
const appConfig = useMyAppConfig();
const url = computed(() => {
const { id } = data?.value || {};
return `${appConfig?.value?.site_url}/s/${id}`;

View File

@@ -3,7 +3,7 @@ import { useQuery } from "@tanstack/vue-query";
import { AsyncButton, Button } from "@/components/ui/button";
import { Skeleton } from "@/components/ui/skeleton";
import { filesize } from "filesize";
import useAppShare from "~/composables/useShare";
import useMyAppShare from "~/composables/useMyAppShare";
import { toast } from "vue-sonner";
const emit = defineEmits<{
(e: "change", key: string): void;
@@ -63,7 +63,7 @@ const { data: taskData, refetch } = useQuery({
enabled: !!taskId.value,
});
const { downloadFile, createFileShare } = useAppShare();
const { downloadFile, createFileShare } = useMyAppShare();
const { counter, pause } = useInterval(2000, { controls: true });

View File

@@ -4,7 +4,8 @@ import { Input } from "@/components/ui/input";
import { useClipboard } from "@vueuse/core";
import { toast } from "vue-sonner";
import { useQuery } from "@tanstack/vue-query";
import useAppShare from "@/composables/useShare";
import useMyAppShare from "~/composables/useMyAppShare";
import useMyAppConfig from "@/composables/useMyAppConfig";
const props = defineProps<{
data: { text: string; config: any; handle_type: string };
@@ -14,7 +15,7 @@ const emit = defineEmits<{
(e: "change", key: string): void;
}>();
const { createTextShare } = useAppShare();
const { createTextShare } = useMyAppShare();
const { data } = useQuery({
queryKey: ["create-share", props?.data?.text],
queryFn: async () => {
@@ -26,7 +27,7 @@ const { data } = useQuery({
return data?.data;
},
});
const appConfig = useAppConfig();
const appConfig = useMyAppConfig();
const url = computed(() => {
const { id } = data?.value || {};
return `${appConfig?.value?.site_url}/s/${id}`;