feat(electron): 添加Electron桌面应用支持

- 新增Electron主进程、预加载脚本和构建配置
- 修改前端配置以支持Electron打包
- 更新项目文档和依赖
- 重构API调用使用统一axios实例
This commit is contained in:
dmy
2026-01-15 00:35:19 +08:00
parent f736f30248
commit eca3f4f9fd
22 changed files with 421 additions and 109 deletions

View File

@@ -48,7 +48,7 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import axios from 'axios'
import api from '../utils/api'
import { ElMessage } from 'element-plus'
import { Loading, InfoFilled, Paperclip } from '@element-plus/icons-vue'
@@ -63,7 +63,7 @@ const pinnedLoading = ref(false)
const loadPinnedBids = async () => {
pinnedLoading.value = true
try {
const response = await axios.get('/api/bids/pinned')
const response = await api.get('/api/bids/pinned')
pinnedBids.value = response.data
} catch (error) {
console.error('Failed to load pinned bids:', error)
@@ -75,7 +75,7 @@ const loadPinnedBids = async () => {
// 切换置顶列表的 Pin 状态
const togglePin = async (item: any) => {
try {
await axios.patch(`/api/bids/${encodeURIComponent(item.title)}/pin`, { pin: false })
await api.patch(`/api/bids/${encodeURIComponent(item.title)}/pin`, { pin: false })
const index = pinnedBids.value.findIndex(b => b.title === item.title)
if (index !== -1) {
pinnedBids.value.splice(index, 1)