解决已知问题
This commit is contained in:
@@ -2,13 +2,13 @@ import Request from '@/utils/request'
|
||||
import { File, FileDir } from '@/types/app/file'
|
||||
|
||||
// 删除文件
|
||||
export const delFileDataAPI = (filePath: string) => Request<File>("DELETE", `/file/plus?filePath=${filePath}`)
|
||||
export const delFileDataAPI = (filePath: string) => Request<File>("DELETE", `/file?filePath=${filePath}`)
|
||||
|
||||
// 获取文件
|
||||
export const getFileDataAPI = (filePath: string) => Request<File>("GET", `/file/plus/info?filePath=${filePath}`)
|
||||
export const getFileDataAPI = (filePath: string) => Request<File>("GET", `/file/info?filePath=${filePath}`)
|
||||
|
||||
// 获取文件列表
|
||||
export const getFileListAPI = (dir: string) => Request<File[]>("GET", `/file/plus/list?dir=${dir}`)
|
||||
export const getFileListAPI = (dir: string) => Request<File[]>("GET", `/file/list?dir=${dir}`)
|
||||
|
||||
// 获取目录列表
|
||||
export const getDirListAPI = () => Request<FileDir[]>("GET", '/file/plus/dir')
|
||||
export const getDirListAPI = () => Request<FileDir[]>("GET", '/file/dir')
|
||||
@@ -52,7 +52,7 @@ export default ({ dir, open, onCancel, onSuccess }: UploadFileProps) => {
|
||||
}
|
||||
|
||||
// 发起网络请求
|
||||
const res = await fetch(`${baseURL}/file/plus`, {
|
||||
const res = await fetch(`${baseURL}/file`, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
headers: {
|
||||
|
||||
@@ -30,7 +30,7 @@ const EditorMD = ({ value, onChange }: Props) => {
|
||||
formData.append("dir", "article");
|
||||
for (let i = 0; i < files.length; i++) formData.append('files', files[i])
|
||||
|
||||
const { data: { code, data } } = await axios.post(`${baseURL}/file/plus`, formData, {
|
||||
const { data: { code, data } } = await axios.post(`${baseURL}/file`, formData, {
|
||||
headers: {
|
||||
"Authorization": `Bearer ${store.token}`,
|
||||
"Content-Type": "multipart/form-data"
|
||||
|
||||
@@ -194,24 +194,28 @@ const StoragePage = () => {
|
||||
<Select options={platformList} placeholder="请选择平台" />
|
||||
</Form.Item>}
|
||||
|
||||
<Form.Item
|
||||
label="Access Key"
|
||||
name="accessKey"
|
||||
rules={[
|
||||
{ required: true, message: 'Access Key 不能为空' },
|
||||
{ min: 10, max: 50, message: 'Access Key 限制在10~50个字符' }
|
||||
]}
|
||||
>
|
||||
<Input placeholder="请输入Access Key" />
|
||||
</Form.Item>
|
||||
{oss.platform !== "local-plus" && (
|
||||
<>
|
||||
<Form.Item
|
||||
label="Access Key"
|
||||
name="accessKey"
|
||||
rules={[
|
||||
{ required: true, message: 'Access Key 不能为空' },
|
||||
{ min: 10, max: 50, message: 'Access Key 限制在10~50个字符' }
|
||||
]}
|
||||
>
|
||||
<Input placeholder="请输入Access Key" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="SecretKey"
|
||||
name="secretKey"
|
||||
rules={[{ required: true, message: 'SecretKey不能为空' }]}
|
||||
>
|
||||
<Input.Password placeholder="请输入SecretKey" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="SecretKey"
|
||||
name="secretKey"
|
||||
rules={[{ required: true, message: 'SecretKey不能为空' }]}
|
||||
>
|
||||
<Input.Password placeholder="请输入SecretKey" />
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
|
||||
<Form.Item
|
||||
label="地域"
|
||||
@@ -221,13 +225,17 @@ const StoragePage = () => {
|
||||
<Input placeholder="请输入地域" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="存储桶"
|
||||
name="bucketName"
|
||||
rules={[{ required: true, message: '存储桶不能为空' }]}
|
||||
>
|
||||
<Input placeholder="请输入存储桶" />
|
||||
</Form.Item>
|
||||
{
|
||||
oss.platform !== "local-plus" && (
|
||||
<Form.Item
|
||||
label="存储桶"
|
||||
name="bucketName"
|
||||
rules={[{ required: true, message: '存储桶不能为空' }]}
|
||||
>
|
||||
<Input placeholder="请输入存储桶" />
|
||||
</Form.Item>
|
||||
)
|
||||
}
|
||||
|
||||
<Form.Item
|
||||
label="域名"
|
||||
@@ -251,7 +259,7 @@ const StoragePage = () => {
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</Modal >
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user