Skip to content

Commit

Permalink
fix: 设置图片上传默认值
Browse files Browse the repository at this point in the history
  • Loading branch information
besscroft committed Sep 28, 2024
1 parent 86a341e commit 50e7144
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/admin/upload/FileUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import React, { useState } from 'react'
import React, { useEffect, useState } from 'react'
import type { UploadProps } from 'antd'
import { Upload, ConfigProvider, Select as AntdSelect } from 'antd'
import { toast } from 'sonner'
Expand All @@ -15,7 +15,6 @@ import {
SelectContent,
SelectGroup,
SelectItem as ShadcnSelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from '~/components/ui/Select'
Expand Down Expand Up @@ -422,6 +421,12 @@ export default function FileUpload() {
}
}

useEffect(() => {
const updatedSet = new Set([] as string[]);
updatedSet.add('r2');
setStorage(updatedSet)
}, []);

return (
<div className="flex flex-col space-y-2 h-full flex-1">
<Card shadow="sm">
Expand Down

0 comments on commit 50e7144

Please sign in to comment.