Merge pull request #19 from Aues6uen11Z/feat/api-url

feat: 添加用于小程序的API URL复制
This commit is contained in:
Aues6uen11Z
2026-01-09 22:09:13 +08:00
committed by GitHub
parent 176a7de220
commit 0e2a345371
6 changed files with 389 additions and 203 deletions

View File

@@ -1,5 +1,5 @@
const { clipboard, ipcMain } = require('electron')
const { getUrl, deleteData } = require('./getData')
const { getUrl, deleteData, getApiUrl } = require('./getData')
ipcMain.handle('COPY_URL', async () => {
const url = await getUrl()
@@ -10,6 +10,15 @@ ipcMain.handle('COPY_URL', async () => {
return false
})
ipcMain.handle('COPY_API_URL', async () => {
const apiUrl = await getApiUrl()
if (apiUrl) {
clipboard.writeText(apiUrl)
return true
}
return false
})
ipcMain.handle('DELETE_DATA', async (event, uid, action) => {
await deleteData(uid, action)
})