📃 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

View File

@@ -1,3 +1,12 @@
VITE_API = /api
VITE_API_MUSIC = /music
VITE_API_PROXY = http://110.42.251.190:9856
# 你的接口地址 (必填)
VITE_API = ***
# 音乐破解接口地址
VITE_API_MUSIC = ***
# 代理地址
VITE_API_PROXY = ***
# 本地运行代理地址
VITE_API_PROXY = /api
VITE_API_MUSIC_PROXY = /music
VITE_API_PROXY_MUSIC = /music_proxy

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
.gitignore vendored
View File

@@ -16,3 +16,5 @@ dist.zip
.vscode
bun.lockb
.env.*.local

View File

@@ -11,6 +11,15 @@
## 预览地址
[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
# 安装依赖
@@ -29,17 +38,33 @@
npm run win ...
# 具体看 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
## 软件截图
![首页](./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)
# .env.production
# 你的接口地址 (必填)
VITE_API = ***
# 音乐破解接口地址
VITE_API_MUSIC = ***
# 代理地址
VITE_API_PROXY = ***
```
## 欢迎提Issues

View File

@@ -54,11 +54,9 @@ export const getIsMc = () => {
if (windowData.electron.ipcRenderer.getStoreValue('set').isProxy) {
return true;
}
if (window.location.origin.includes('localhost')) {
}
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) => {
if (!getIsMc()) {

View File

@@ -36,15 +36,20 @@ export default defineConfig({
port: 4488,
proxy: {
// with options
'/api': {
target: 'http://110.42.251.190:9898',
[process.env.VITE_API_PROXY as string]: {
target: process.env.VITE_API,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
rewrite: (path) => path.replace(new RegExp(`^${process.env.VITE_API_PROXY}`), ''),
},
'/music': {
target: 'http://110.42.251.190:4100',
[process.env.VITE_API_MUSIC_PROXY as string]: {
target: process.env.VITE_API_MUSIC,
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}`), ''),
},
},
},