feat: 完善网页版 安装应用功能

This commit is contained in:
alger
2025-01-01 22:42:25 +08:00
parent 8dab799939
commit 38a9d6ed31
4 changed files with 71 additions and 31 deletions
+6 -2
View File
@@ -1,13 +1,17 @@
import axios, { InternalAxiosRequestConfig } from 'axios';
const setData = window.electron.ipcRenderer.sendSync('get-store-value', 'set')
let setData: any = null;
if (window.electron) {
setData = window.electron.ipcRenderer.sendSync('get-store-value', 'set');
}
// 扩展请求配置接口
interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
retryCount?: number;
}
const baseURL = window.electron ? `http://127.0.0.1:${setData.musicApiPort}` : import.meta.env.VITE_API;
const baseURL = window.electron ? `http://127.0.0.1:${setData?.musicApiPort}` : import.meta.env.VITE_API;
const request = axios.create({
baseURL,