feat: 压缩图片,提取host

This commit is contained in:
秋水浮尘
2023-11-09 22:35:29 +08:00
parent 25f1c269cd
commit 9f74e8094d
12 changed files with 35 additions and 28 deletions

0
.env Normal file
View File

2
.env.development Normal file
View File

@@ -0,0 +1,2 @@
VITE_API_HOST=http://117.72.14.166:3010
VITE_IMG_HOST=http://117.72.14.166:9000

1
.env.production Normal file
View File

@@ -0,0 +1 @@
VITE_API_HOST=http://117.72.14.166:3010

View File

@@ -4,7 +4,7 @@
"version": "0.0.1",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build": "vite build",
"preview": "vite preview",
"eslint": "eslint --max-warnings=0",
"pre-check": "tsc && npx lint-staged",

View File

@@ -1,3 +1,4 @@
const host = import.meta.env.VITE_IMG_HOST
/**
* 难度筛选
*/
@@ -56,7 +57,7 @@ export const gradeObject = {
export const imgObject = {
clickImg:
'http://117.72.14.166:9000/jichi/icon/%E7%83%AD%E9%97%A8.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20231102%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231102T153146Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=e6b8cdb3231b1c3d7114212cb9278ecc17cf6d4ec0f759ea0200e04156d4c8b7',
host + '/jichi/icon/%E7%83%AD%E9%97%A8.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20231102%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231102T153146Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=e6b8cdb3231b1c3d7114212cb9278ecc17cf6d4ec0f759ea0200e04156d4c8b7',
ranking1Img:
'https://img12.360buyimg.com/imagetools/jfs/t1/110906/3/22471/3750/6214a3bfE392596cf/122c9e4b30948682.png',
ranking2Img:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 KiB

After

Width:  |  Height:  |  Size: 313 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 254 KiB

View File

@@ -37,7 +37,6 @@ const Header = () => {
const navigate = useNavigate()
const handleMenuClick = e => {
console.log(e)
if (e.key != 1) {
return message.info('敬请期待')
}
@@ -68,9 +67,9 @@ const Header = () => {
/>
</div>
)}
<div className="head-navigator-bell">
{/* <Icon type="bell" /> */}
</div>
{/* <div className="head-navigator-bell"> */}
{/* <Icon type="bell" /> */}
{/* </div> */}
<div className="head-navigator-user-img">
<Dropdown
menu={{

View File

@@ -1,27 +1,31 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
const path = require('path')
// const HOST = import.meta.env.VITE_API_URL
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@assets': path.resolve(__dirname, 'src/assets'),
'@views': path.resolve(__dirname, 'src/views'),
'@utils': path.resolve(__dirname, 'src/utils'),
'@components': path.resolve(__dirname, 'src/components'),
'@imgs': path.resolve(__dirname, 'src/imgs'),
'@constants': path.resolve(__dirname, 'src/constants'),
}
},
plugins: [react()],
server: {
proxy: {
"/subject": {
target: "http://117.72.14.166:3010",
changeOrigin: true,
},
export default ({ mode }) => {
const env = loadEnv(mode, process.cwd());
return defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@assets': path.resolve(__dirname, 'src/assets'),
'@views': path.resolve(__dirname, 'src/views'),
'@utils': path.resolve(__dirname, 'src/utils'),
'@components': path.resolve(__dirname, 'src/components'),
'@imgs': path.resolve(__dirname, 'src/imgs'),
'@constants': path.resolve(__dirname, 'src/constants'),
}
},
}
})
plugins: [react()],
server: {
proxy: {
"/subject": {
target: env.VITE_API_HOST,
changeOrigin: true,
},
},
}
})
}