From 15a560ea2538f387c421cf3ecf77c0e694e3fbcb Mon Sep 17 00:00:00 2001 From: plightfield <1207120484@qq.com> Date: Fri, 13 Sep 2024 12:19:12 +0800 Subject: [PATCH] change --- src/config.ts | 54 ++++++- src/layout/adder/AdderPage.tsx | 97 +++++++------ src/layout/adder/CustomAdder.tsx | 176 +++++++++-------------- src/layout/background/BackgroundPage.tsx | 2 +- src/layout/background/getResource.ts | 97 +++++++++++++ src/layout/background/index.tsx | 12 +- src/layout/header/search/SearchPage.tsx | 7 +- src/layout/layout.types.ts | 6 +- src/layout/sider/index.tsx | 6 +- src/layout/useLayoutStore.ts | 29 +++- src/settings/SettingsOverlay.tsx | 14 +- src/settings/SettingsOverlayContent.tsx | 21 +++ src/settings/useSettingsStore.ts | 1 - src/utils/ImageUploader.tsx | 110 +++++++------- src/utils/ThemeProvider.tsx | 27 ++++ 15 files changed, 417 insertions(+), 242 deletions(-) create mode 100644 src/layout/background/getResource.ts create mode 100644 src/settings/SettingsOverlayContent.tsx create mode 100644 src/utils/ThemeProvider.tsx diff --git a/src/config.ts b/src/config.ts index f60553a..1ead83b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,10 +1,13 @@ export const aIUrl = 'https://metaso.cn/?s=uitab&referrer_s=uitab&q=' export const translateUrl = 'https://fanyi.baidu.com/mtpe-individual/multimodal?lang=zh2en&query=' -// 获取 oss 根目录地址 +// oss地址 export const ossBase = import.meta.env.PROD ? 'http://btab.oss-cn-hangzhou.aliyuncs.com' : 'http://btab.oss-cn-hangzhou.aliyuncs.com' +// oss cdn 加速地址 +export const ossCdnBase = import.meta.env.PROD ? ossBase : ossBase + // 后端地址 export const apiBase = import.meta.env.PROD ? 'http://192.168.110.28:8300' @@ -12,3 +15,52 @@ export const apiBase = import.meta.env.PROD // 后端 cdn 加速地址 export const cdnBase = import.meta.env.PROD ? apiBase : apiBase + +// 图片后缀名 +export const imgArr = [ + 'bmp', + 'cod', + 'gif', + 'lef', + 'jpe', + 'jpeg', + 'jpg', + 'jfif', + 'svg', + 'tif', + 'tiff', + 'ras', + 'cmx', + 'ico', + 'pnm', + 'pbm', + 'pgm', + 'rgb', + 'xbm', + 'xpm', + 'xwd', + 'png' +] +// 视频后缀名 +export const videoArr = [ + 'mp4', + 'mpg', + 'mpeg', + 'mpe', + 'qt', + 'mov', + 'm4v', + 'wmv', + 'avi', + 'webm', + 'flv', + 'mp2', + 'mpa', + 'mpv2', + 'lsf', + 'lsx', + 'asf', + 'asr', + 'asx', + 'movie' +] diff --git a/src/layout/adder/AdderPage.tsx b/src/layout/adder/AdderPage.tsx index 62b8520..19869bd 100644 --- a/src/layout/adder/AdderPage.tsx +++ b/src/layout/adder/AdderPage.tsx @@ -5,6 +5,7 @@ import { OhVueIcon, addIcons } from 'oh-vue-icons' import { MdKeyboardcommandkey, FaCompass, FaPencilRuler } from 'oh-vue-icons/icons' import CustomAdder from './CustomAdder' import clsx from 'clsx' +import ThemeProvider from '@/utils/ThemeProvider' addIcons(MdKeyboardcommandkey, FaCompass, FaPencilRuler) const ItemButton = defineComponent({ @@ -54,55 +55,57 @@ export default defineComponent(() => { const isGame = computed(() => layout.state.current === 0) const type = ref(1) return () => ( -
- {isGame.value && } -
- { - type.value = 0 - }} - /> - { - type.value = 1 - }} - /> - { - type.value = 2 - }} - /> -
-
e.stopPropagation()} - > -
-