📃 docs: 修改文档

This commit is contained in:
alger
2024-12-07 11:38:56 +08:00
parent e326253fd8
commit 42048764d5
6 changed files with 59 additions and 23 deletions
+12 -3
View File
@@ -1,3 +1,12 @@
VITE_API = /api # 你的接口地址 (必填)
VITE_API_MUSIC = /music VITE_API = ***
VITE_API_PROXY = http://110.42.251.190:9856 # 音乐破解接口地址
VITE_API_MUSIC = ***
# 代理地址
VITE_API_PROXY = ***
# 本地运行代理地址
VITE_API_PROXY = /api
VITE_API_MUSIC_PROXY = /music
VITE_API_PROXY_MUSIC = /music_proxy
-3
View File
@@ -1,3 +0,0 @@
VITE_API = http://110.42.251.190:9898
VITE_API_MUSIC = http://110.42.251.190:4100
VITE_API_PROXY = http://110.42.251.190:9856
+2
View File
@@ -16,3 +16,5 @@ dist.zip
.vscode .vscode
bun.lockb bun.lockb
.env.*.local
+33 -8
View File
@@ -11,6 +11,15 @@
## 预览地址 ## 预览地址
[http://mc.alger.fun/](http://mc.alger.fun/) [http://mc.alger.fun/](http://mc.alger.fun/)
## 软件截图
![首页](./docs/img/image-7.png)
![歌词](./docs/img/image-6.png)
![歌单](./docs/img/image-1.png)
![搜索](./docs/img/image-8.png)
![mv](./docs/img/image-3.png)
![历史](./docs/img/image-4.png)
![我的](./docs/img/image-5.png)
## 项目运行 ## 项目运行
```bash ```bash
# 安装依赖 # 安装依赖
@@ -29,17 +38,33 @@
npm run win ... npm run win ...
# 具体看 package.json # 具体看 package.json
``` ```
#### 注意
- 本地运行需要配置 .env.development 文件
- 打包需要配置 .env.production 文件
```bash
# .env.development
# 你的接口地址 (必填)
VITE_API = ***
# 音乐破解接口地址
VITE_API_MUSIC = ***
# 代理地址
VITE_API_PROXY = ***
# 本地运行代理地址
VITE_API_PROXY = /api
VITE_API_MUSIC_PROXY = /music
VITE_API_PROXY_MUSIC = /music_proxy
## 软件截图 # .env.production
![首页](./docs/img/image-7.png) # 你的接口地址 (必填)
![歌词](./docs/img/image-6.png) VITE_API = ***
![歌单](./docs/img/image-1.png) # 音乐破解接口地址
![搜索](./docs/img/image-8.png) VITE_API_MUSIC = ***
![mv](./docs/img/image-3.png) # 代理地址
![历史](./docs/img/image-4.png) VITE_API_PROXY = ***
![我的](./docs/img/image-5.png) ```
## 欢迎提Issues ## 欢迎提Issues
+1 -3
View File
@@ -54,11 +54,9 @@ export const getIsMc = () => {
if (windowData.electron.ipcRenderer.getStoreValue('set').isProxy) { if (windowData.electron.ipcRenderer.getStoreValue('set').isProxy) {
return true; return true;
} }
if (window.location.origin.includes('localhost')) {
}
return false; return false;
}; };
const ProxyUrl = import.meta.env.VITE_API_PROXY || 'http://110.42.251.190:9856'; const ProxyUrl = import.meta.env.VITE_API_PROXY;
export const getMusicProxyUrl = (url: string) => { export const getMusicProxyUrl = (url: string) => {
if (!getIsMc()) { if (!getIsMc()) {
+11 -6
View File
@@ -36,15 +36,20 @@ export default defineConfig({
port: 4488, port: 4488,
proxy: { proxy: {
// with options // with options
'/api': { [process.env.VITE_API_PROXY as string]: {
target: 'http://110.42.251.190:9898', target: process.env.VITE_API,
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(new RegExp(`^${process.env.VITE_API_PROXY}`), ''),
}, },
'/music': { [process.env.VITE_API_MUSIC_PROXY as string]: {
target: 'http://110.42.251.190:4100', target: process.env.VITE_API_MUSIC,
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/music/, ''), rewrite: (path) => path.replace(new RegExp(`^${process.env.VITE_API_MUSIC_PROXY}`), ''),
},
[process.env.VITE_API_PROXY_MUSIC as string]: {
target: process.env.VITE_API_PROXY,
changeOrigin: true,
rewrite: (path) => path.replace(new RegExp(`^${process.env.VITE_API_PROXY_MUSIC}`), ''),
}, },
}, },
}, },