feat: 压缩图片,提取host
2
.env.development
Normal 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
@@ -0,0 +1 @@
|
|||||||
|
VITE_API_HOST=http://117.72.14.166:3010
|
@@ -4,7 +4,7 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"eslint": "eslint --max-warnings=0",
|
"eslint": "eslint --max-warnings=0",
|
||||||
"pre-check": "tsc && npx lint-staged",
|
"pre-check": "tsc && npx lint-staged",
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
const host = import.meta.env.VITE_IMG_HOST
|
||||||
/**
|
/**
|
||||||
* 难度筛选
|
* 难度筛选
|
||||||
*/
|
*/
|
||||||
@@ -56,7 +57,7 @@ export const gradeObject = {
|
|||||||
|
|
||||||
export const imgObject = {
|
export const imgObject = {
|
||||||
clickImg:
|
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:
|
ranking1Img:
|
||||||
'https://img12.360buyimg.com/imagetools/jfs/t1/110906/3/22471/3750/6214a3bfE392596cf/122c9e4b30948682.png',
|
'https://img12.360buyimg.com/imagetools/jfs/t1/110906/3/22471/3750/6214a3bfE392596cf/122c9e4b30948682.png',
|
||||||
ranking2Img:
|
ranking2Img:
|
||||||
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 565 KiB After Width: | Height: | Size: 313 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 254 KiB |
@@ -37,7 +37,6 @@ const Header = () => {
|
|||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const handleMenuClick = e => {
|
const handleMenuClick = e => {
|
||||||
console.log(e)
|
|
||||||
if (e.key != 1) {
|
if (e.key != 1) {
|
||||||
return message.info('敬请期待')
|
return message.info('敬请期待')
|
||||||
}
|
}
|
||||||
@@ -68,9 +67,9 @@ const Header = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="head-navigator-bell">
|
{/* <div className="head-navigator-bell"> */}
|
||||||
{/* <Icon type="bell" /> */}
|
{/* <Icon type="bell" /> */}
|
||||||
</div>
|
{/* </div> */}
|
||||||
<div className="head-navigator-user-img">
|
<div className="head-navigator-user-img">
|
||||||
<Dropdown
|
<Dropdown
|
||||||
menu={{
|
menu={{
|
||||||
|
@@ -1,27 +1,31 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig, loadEnv } from 'vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
// const HOST = import.meta.env.VITE_API_URL
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default ({ mode }) => {
|
||||||
resolve: {
|
const env = loadEnv(mode, process.cwd());
|
||||||
alias: {
|
return defineConfig({
|
||||||
'@': path.resolve(__dirname, 'src'),
|
resolve: {
|
||||||
'@assets': path.resolve(__dirname, 'src/assets'),
|
alias: {
|
||||||
'@views': path.resolve(__dirname, 'src/views'),
|
'@': path.resolve(__dirname, 'src'),
|
||||||
'@utils': path.resolve(__dirname, 'src/utils'),
|
'@assets': path.resolve(__dirname, 'src/assets'),
|
||||||
'@components': path.resolve(__dirname, 'src/components'),
|
'@views': path.resolve(__dirname, 'src/views'),
|
||||||
'@imgs': path.resolve(__dirname, 'src/imgs'),
|
'@utils': path.resolve(__dirname, 'src/utils'),
|
||||||
'@constants': path.resolve(__dirname, 'src/constants'),
|
'@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,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
plugins: [react()],
|
||||||
})
|
server: {
|
||||||
|
proxy: {
|
||||||
|
"/subject": {
|
||||||
|
target: env.VITE_API_HOST,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|