diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..785174b Binary files /dev/null and b/dist.zip differ diff --git a/public/icons/uploadImg.png b/public/icons/uploadImg.png new file mode 100644 index 0000000..1b309bd Binary files /dev/null and b/public/icons/uploadImg.png differ diff --git a/src/layout/background/BackgroundSwtich.tsx b/src/layout/background/BackgroundSwtich.tsx index bd20ee1..020039d 100644 --- a/src/layout/background/BackgroundSwtich.tsx +++ b/src/layout/background/BackgroundSwtich.tsx @@ -9,6 +9,8 @@ import request from '@/utils/request' import useUserStore from '@/user/useUserStore' import useRouterStore from '@/useRouterStore' import useBackgroundStore from './useBackgroundStore' +import { Button } from 'ant-design-vue' +import CustomWallpaper from './CustomWallpaper' addIcons(BiChevronLeft, BiChevronDown) @@ -52,6 +54,7 @@ export default defineComponent(() => { const wallpaperList = ref([]) const selectAttr = ref(0) const userStore = useUserStore() + const sortBy = ref<'hotNum' | 'time'>('hotNum') onMounted(() => { request('GET', '/api/backgroundTypes').then((res) => { @@ -63,6 +66,7 @@ export default defineComponent(() => { watch( () => [selectType.value, sortBy.value], (e) => { + if (!e[0]) return wallpaperList.value = [] request('GET', `/api/backgrounds?typeId=${e[0]}&sort=${sortBy.value}`).then( (res) => { @@ -76,7 +80,7 @@ export default defineComponent(() => { } ) watch(selectAttr, (e) => { - selectType.value = typeList.value.filter((val) => val.attr === e)[0].id || '' + selectType.value = typeList.value.filter((val) => val.attr === e)[0]?.id || '' }) return () => (
{