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

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## 项目运行
|
||||
```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
|
||||
|
||||
## 软件截图
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
# .env.production
|
||||
# 你的接口地址 (必填)
|
||||
VITE_API = ***
|
||||
# 音乐破解接口地址
|
||||
VITE_API_MUSIC = ***
|
||||
# 代理地址
|
||||
VITE_API_PROXY = ***
|
||||
```
|
||||
|
||||
## 欢迎提Issues
|
||||
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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}`), ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user