mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-28 19:07:23 +08:00
🌈 style: 去除无用代码
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
VITE_API = /api
|
VITE_API = /api
|
||||||
VITE_API_MT = /mt
|
|
||||||
VITE_API_MUSIC = /music
|
VITE_API_MUSIC = /music
|
||||||
VITE_API_PROXY = http://110.42.251.190:9856
|
VITE_API_PROXY = http://110.42.251.190:9856
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
VITE_API = http://110.42.251.190:9898
|
VITE_API = http://110.42.251.190:9898
|
||||||
VITE_API_MT = http://mt.myalger.top
|
|
||||||
VITE_API_MUSIC = http://110.42.251.190:4100
|
VITE_API_MUSIC = http://110.42.251.190:4100
|
||||||
VITE_API_PROXY = http://110.42.251.190:9856
|
VITE_API_PROXY = http://110.42.251.190:9856
|
||||||
@@ -7,6 +7,27 @@
|
|||||||
- 播放历史
|
- 播放历史
|
||||||
- 歌单 mv 搜索 专辑等功能
|
- 歌单 mv 搜索 专辑等功能
|
||||||
|
|
||||||
|
## 项目运行
|
||||||
|
```bash
|
||||||
|
# 安装依赖
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# 运行项目 web
|
||||||
|
npm run dev
|
||||||
|
|
||||||
|
# 运行项目 electron
|
||||||
|
npm run start
|
||||||
|
|
||||||
|
# 打包项目 web
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# 打包项目 electron
|
||||||
|
npm run win ...
|
||||||
|
# 具体看 package.json
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 软件截图
|
## 软件截图
|
||||||

|

|
||||||

|

|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"appId": "com.alger.music",
|
|
||||||
"productName": "AlgerMusic",
|
|
||||||
"directories": {
|
|
||||||
"output": "dist_electron"
|
|
||||||
},
|
|
||||||
"files": ["dist/**/*", "package.json", "app.js", "electron/**/*"],
|
|
||||||
"win": {
|
|
||||||
"icon": "public/icon.png",
|
|
||||||
"target": "nsis",
|
|
||||||
"extraFiles": [
|
|
||||||
{
|
|
||||||
"from": "installer/installer.nsh",
|
|
||||||
"to": "$INSTDIR"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -46,7 +46,6 @@ import { getSearchKeyword } from '@/api/home';
|
|||||||
import { getUserDetail, logout } from '@/api/login';
|
import { getUserDetail, logout } from '@/api/login';
|
||||||
import { SEARCH_TYPES, USER_SET_OPTIONS } from '@/const/bar-const';
|
import { SEARCH_TYPES, USER_SET_OPTIONS } from '@/const/bar-const';
|
||||||
import { getImgUrl } from '@/utils';
|
import { getImgUrl } from '@/utils';
|
||||||
import request from '@/utils/request_mt';
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
@@ -106,30 +105,15 @@ const search = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectSearchType = (key: any) => {
|
const selectSearchType = (key: number) => {
|
||||||
searchType.value = key;
|
searchType.value = key;
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchTypeOptions = ref(SEARCH_TYPES);
|
const searchTypeOptions = ref(SEARCH_TYPES);
|
||||||
|
|
||||||
const selectItem = async (key: any) => {
|
const selectItem = async (key: string) => {
|
||||||
// switch 判断
|
// switch 判断
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'card':
|
|
||||||
await request.get('/?do=sign').then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'card_music':
|
|
||||||
await request.get('/?do=daka').then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'listen':
|
|
||||||
await request.get('/?do=listen&id=1885175990&time=300').then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'logout':
|
case 'logout':
|
||||||
logout().then(() => {
|
logout().then(() => {
|
||||||
store.state.user = null;
|
store.state.user = null;
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
import axios from 'axios';
|
|
||||||
|
|
||||||
const baseURL = `${import.meta.env.VITE_API_MT}`;
|
|
||||||
const request = axios.create({
|
|
||||||
baseURL,
|
|
||||||
timeout: 10000,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 请求拦截器
|
|
||||||
request.interceptors.request.use(
|
|
||||||
(config) => {
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
// 当请求异常时做一些处理
|
|
||||||
return Promise.reject(error);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
export default request;
|
|
||||||
+2
-5
@@ -1,8 +1,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
purge: [
|
purge: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
|
||||||
'./index.html',
|
|
||||||
'./src/**/*.{vue,js,ts,jsx,tsx}'
|
|
||||||
],
|
|
||||||
darkMode: false, // or 'media' or 'class'
|
darkMode: false, // or 'media' or 'class'
|
||||||
theme: {
|
theme: {
|
||||||
extend: {},
|
extend: {},
|
||||||
@@ -11,4 +8,4 @@ module.exports = {
|
|||||||
extend: {},
|
extend: {},
|
||||||
},
|
},
|
||||||
plugins: [],
|
plugins: [],
|
||||||
}
|
};
|
||||||
|
|||||||
+9
-20
@@ -1,10 +1,10 @@
|
|||||||
import { defineConfig } from 'vite'
|
import vue from '@vitejs/plugin-vue';
|
||||||
import vue from '@vitejs/plugin-vue'
|
import path from 'path';
|
||||||
import path from 'path'
|
|
||||||
// import VueDevTools from 'vite-plugin-vue-devtools'
|
// import VueDevTools from 'vite-plugin-vue-devtools'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite';
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers';
|
||||||
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
import Components from 'unplugin-vue-components/vite';
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@@ -15,12 +15,7 @@ export default defineConfig({
|
|||||||
imports: [
|
imports: [
|
||||||
'vue',
|
'vue',
|
||||||
{
|
{
|
||||||
'naive-ui': [
|
'naive-ui': ['useDialog', 'useMessage', 'useNotification', 'useLoadingBar'],
|
||||||
'useDialog',
|
|
||||||
'useMessage',
|
|
||||||
'useNotification',
|
|
||||||
'useLoadingBar',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
@@ -35,16 +30,10 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0', //允许本机
|
host: '0.0.0.0',
|
||||||
// 指定端口
|
// 指定端口
|
||||||
port: 4678,
|
port: 4678,
|
||||||
proxy: {
|
proxy: {
|
||||||
// string shorthand
|
|
||||||
'/mt': {
|
|
||||||
target: 'http://mt.myalger.top',
|
|
||||||
changeOrigin: true,
|
|
||||||
rewrite: (path) => path.replace(/^\/mt/, ''),
|
|
||||||
},
|
|
||||||
// with options
|
// with options
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://110.42.251.190:9898',
|
target: 'http://110.42.251.190:9898',
|
||||||
@@ -69,4 +58,4 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user