From 3d60f1478ac9a3608bf90ab202b62bf189637f71 Mon Sep 17 00:00:00 2001 From: landaiqing <3517283258@qq.com> Date: Thu, 16 May 2024 01:07:34 +0800 Subject: [PATCH] feat: update --- .env.development | 3 ++- .env.production | 2 +- src/api/oss/minio/index.ts | 12 ++++++++++++ src/views/Home/index.tsx | 21 +++++++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/api/oss/minio/index.ts diff --git a/.env.development b/.env.development index 665180d..122e2b7 100644 --- a/.env.development +++ b/.env.development @@ -8,7 +8,8 @@ VITE_APP_BASE_API='/api' VITE_APP_TITLE=开发环境 # 网络请求公用地址 -VITE_API_BASE_URL='http://127.0.0.1:3000' +#VITE_API_BASE_URL='http://127.0.0.1:3000' +VITE_API_BASE_URL='http://1.95.0.111:3000' VITE_TITLE_NAME='五味子云存储' diff --git a/.env.production b/.env.production index b84bcd5..fe08623 100644 --- a/.env.production +++ b/.env.production @@ -7,7 +7,7 @@ VITE_APP_BASE_API='/api' VITE_APP_TITLE=生产环境 # 网络请求公用地址 -VITE_API_BASE_URL='http://1.95.0.111:3000' +VITE_API_BASE_URL='http://1.95.0.111:4000' VITE_TITLE_NAME='五味子云存储' diff --git a/src/api/oss/minio/index.ts b/src/api/oss/minio/index.ts new file mode 100644 index 0000000..c0d9f2e --- /dev/null +++ b/src/api/oss/minio/index.ts @@ -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) +} diff --git a/src/views/Home/index.tsx b/src/views/Home/index.tsx index cccf81d..29323d0 100644 --- a/src/views/Home/index.tsx +++ b/src/views/Home/index.tsx @@ -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 (