mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-18 11:37:31 +08:00
📃 docs: 修改文档
This commit is contained in:
+12
-3
@@ -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
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -16,3 +16,5 @@ dist.zip
|
|||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
bun.lockb
|
bun.lockb
|
||||||
|
|
||||||
|
.env.*.local
|
||||||
@@ -11,6 +11,15 @@
|
|||||||
## 预览地址
|
## 预览地址
|
||||||
[http://mc.alger.fun/](http://mc.alger.fun/)
|
[http://mc.alger.fun/](http://mc.alger.fun/)
|
||||||
|
|
||||||
|
## 软件截图
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
## 项目运行
|
## 项目运行
|
||||||
```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
|
||||||

|
# 你的接口地址 (必填)
|
||||||

|
VITE_API = ***
|
||||||

|
# 音乐破解接口地址
|
||||||

|
VITE_API_MUSIC = ***
|
||||||

|
# 代理地址
|
||||||

|
VITE_API_PROXY = ***
|
||||||

|
```
|
||||||
|
|
||||||
## 欢迎提Issues
|
## 欢迎提Issues
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -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
@@ -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}`), ''),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user