diff --git a/.gitignore b/.gitignore index 76371959..1a7328ba 100755 --- a/.gitignore +++ b/.gitignore @@ -80,4 +80,5 @@ frontend/app/* CLAUDE.md AGENTS.md .codebuddy -.agent \ No newline at end of file +.agent +.workbuddy \ No newline at end of file diff --git a/frontend/web/src/App.vue b/frontend/web/src/App.vue index 0b90adf3..2929975d 100755 --- a/frontend/web/src/App.vue +++ b/frontend/web/src/App.vue @@ -7,17 +7,7 @@ shadow: 'never', }" > - - - - - - + @@ -25,15 +15,12 @@ import { computed, onBeforeMount, onErrorCaptured, onMounted, onUnmounted } from "vue"; import { ElMessage } from "element-plus"; import { useWindowSize } from "@vueuse/core"; -import { useAppStore, useUserStore } from "./store"; -import { useSettingsStore } from "./store/modules/setting.store"; -import { defaultSettings } from "./config/setting"; +import { useAppStore } from "./store"; import { ComponentSize } from "./enums/settings/layout.enum"; import { MOBILE_BREAKPOINT } from "./utils/constants/definitions"; -import { hexToRgba, toggleTransition } from "./utils/ui"; +import { toggleTransition } from "./utils/ui"; import { initializeTheme } from "./hooks/core/useTheme"; import { useAppBootstrap } from "@/hooks/core/useAppBootstrap"; -import { ThemeMode } from "./enums"; import en from "element-plus/es/locale/lang/en"; import zhCn from "element-plus/es/locale/lang/zh-cn"; import { router } from "@/router"; @@ -41,8 +28,6 @@ import { ElNotification } from "element-plus"; import { initIconifyAsync } from "./plugins/iconify"; const appStore = useAppStore(); -const settingsStore = useSettingsStore(); -const userStore = useUserStore(); const { width } = useWindowSize(); // H5 用小尺寸,桌面用用户设置的大小 @@ -50,32 +35,12 @@ const size = computed(() => { if (width.value < MOBILE_BREAKPOINT) return "small" as ComponentSize; return appStore.size as ComponentSize; }); -const showWatermark = computed(() => settingsStore.showWatermark); -const watermarkContent = defaultSettings.watermarkContent; // 根据语言设置返回对应的语言包 const locale = computed(() => { return appStore.language === "en" ? en : zhCn; }); -// 只有在启用 AI 助手且用户已登录时才显示 -const enableAiAssistant = computed(() => { - const isEnabled = settingsStore.userEnableAi; - const isLoggedIn = userStore.basicInfo && Object.keys(userStore.basicInfo).length > 0; - return isEnabled && isLoggedIn; -}); - -// 水印文字默认使用当前主题色(半透明),随主题色设置变化 -const fontColor = computed(() => { - const hex = settingsStore.themeColor || defaultSettings.themeColor; - const alpha = settingsStore.theme === ThemeMode.DARK ? 0.22 : 0.16; - try { - return hexToRgba(hex, alpha).rgba; - } catch { - return hexToRgba(defaultSettings.themeColor, alpha).rgba; - } -}); - /** * 应用根组件生命周期: * diff --git a/frontend/web/src/components/actions/fa-upload/index.vue b/frontend/web/src/components/actions/fa-upload/index.vue index 71cb77ec..9129ee31 100644 --- a/frontend/web/src/components/actions/fa-upload/index.vue +++ b/frontend/web/src/components/actions/fa-upload/index.vue @@ -20,7 +20,6 @@ :tool="true" :show-preview="true" :original-graph="false" - :file-type="cropFileType" :title="cropInnerTitle" :preview-title="cropPreviewTitle" @update:img-url="onCropConfirm" @@ -129,7 +128,6 @@ interface Props { cropCutWidth?: number; cropCutHeight?: number; cropQuality?: number; - cropFileType?: "png" | "jpeg" | "webp"; cropDialogTitle?: string; cropInnerTitle?: string; cropPreviewTitle?: string; @@ -151,7 +149,6 @@ const props = withDefaults(defineProps(), { cropCutWidth: 360, cropCutHeight: 200, cropQuality: 1, - cropFileType: "jpeg", cropDialogTitle: "裁剪图片", cropInnerTitle: "调整图片", cropPreviewTitle: "预览", @@ -167,6 +164,7 @@ const internalFileList = ref([]); const cropVisible = ref(false); const cropSourceUrl = ref(""); +const cropFileName = ref(""); function revokeCropUrl() { if (cropSourceUrl.value.startsWith("blob:")) { @@ -185,9 +183,7 @@ function onCropError() { async function onCropConfirm(dataURL: string) { try { - const ext = - props.cropFileType === "png" ? "png" : props.cropFileType === "webp" ? "webp" : "jpg"; - const file = dataURLToFile(dataURL, `upload.${ext}`); + const file = dataURLToFile(dataURL, cropFileName.value); await uploadFileInternal(file); cropVisible.value = false; revokeCropUrl(); @@ -293,6 +289,11 @@ function handleBeforeUpload(file: UploadRawFile) { } if (props.enableCrop) { + // 非 canvas 兼容格式(如 svg/gif/bmp 等),跳过裁剪直接上传 + if (file.type !== "image/png" && file.type !== "image/jpeg" && file.type !== "image/webp") { + return true; + } + cropFileName.value = file.name; revokeCropUrl(); cropSourceUrl.value = URL.createObjectURL(file); cropVisible.value = true; diff --git a/frontend/web/src/components/others/fa-watermark/index.vue b/frontend/web/src/components/others/fa-watermark/index.vue index 242fa248..6b81d7e0 100644 --- a/frontend/web/src/components/others/fa-watermark/index.vue +++ b/frontend/web/src/components/others/fa-watermark/index.vue @@ -20,7 +20,6 @@