feat: update

This commit is contained in:
landaiqing
2024-05-16 01:07:34 +08:00
parent aef23e6dd5
commit 3d60f1478a
4 changed files with 36 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
import web from '@/utils/axios/web.ts'
/**
* 初始化minio
*/
export const initMinio = (data: string) => {
return web.post('/oss/minio/init', data)
}
export const getBaseInfo = (data: string) => {
return web.post('/oss/minio/getBaseInfo', data)
}

View File

@@ -1,9 +1,30 @@
import HomeIndex from '@/components/HomeIndex'
import { useEffect } from 'react'
import { getBaseInfo, initMinio } from '@/api/oss/minio'
import { Button } from 'antd'
export default () => {
const minioInit = () => {
initMinio('1').then(() => {
getBaseInfo('wallhaven-1pd98v.jpg').then((res) => {
console.log(res)
})
})
}
const init = () => {
initMinio('2').then(() => {
getBaseInfo('background.png').then((res) => {
console.log(res)
})
})
}
useEffect(() => {}, [])
return (
<div>
<HomeIndex />
<Button onClick={minioInit}></Button>
<Button onClick={init}></Button>
</div>
)
}