From 0e2a345371158e217734dd773343aa64eb350694 Mon Sep 17 00:00:00 2001 From: Aues6uen11Z <79563000+Aues6uen11Z@users.noreply.github.com> Date: Fri, 9 Jan 2026 22:09:13 +0800 Subject: [PATCH] Merge pull request #19 from Aues6uen11Z/feat/api-url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat: 添加用于小程序的API URL复制 --- src/i18n/English.json | 6 +- src/i18n/简体中文.json | 6 +- src/i18n/繁體中文.json | 6 +- src/main/bridge.js | 11 +- src/main/getData.js | 14 +- src/renderer/App.vue | 549 ++++++++++++++++++++++++++--------------- 6 files changed, 389 insertions(+), 203 deletions(-) diff --git a/src/i18n/English.json b/src/i18n/English.json index 1e08bfb..785a9f2 100644 --- a/src/i18n/English.json +++ b/src/i18n/English.json @@ -13,7 +13,8 @@ "ui.button.startProxy": "Proxy mode", "ui.button.solution": "Solution", "ui.button.cacheFolder": "Open cache folder", - "ui.button.copyUrl": "Copy URL", + "ui.button.copyUrl": "Copy Web URL", + "ui.button.copyApiUrl": "Copy API URL", "ui.select.newAccount": "New account", "ui.hint.newAccount": "Export data from other accounts", "ui.hint.init": "Please open your warp history inside the game client before clicking on the 'Load data' button", @@ -104,6 +105,7 @@ "uigf.fileType": "Uniformed Interchangeable GachaLog Format v4.0, v4.1", "ui.extra.cacheClean": "1. Confirm whether the search history in the game has been opened, and if the error \"User authentication expired\" still appears, try the following steps \n2. Close the game window of Zenless Zone Zero \n3. Click the \"Open Web Cache Folder\" button above to open the \"Cache\" folder \n4. Delete the \"Cache_Data\" folder \n5. Start the Zenless Zone Zero game and open the search history page in the game \n6. Close this dialog and click the \"Update Data\" button", "ui.extra.findCacheFolder": "If the \"Open cache folder\" button does not respond, you can manually find the game's web cache folder. The directory is \"Your game installation path/ZenlessZoneZero_Data/webCaches/Cache/\"", - "ui.extra.urlCopied": "URL Copied", + "ui.extra.urlCopied": "Web URL Copied", + "ui.extra.apiUrlCopied": "API URL Copied", "ui.uigf.title": "Please select the UID(s) you want to export" } diff --git a/src/i18n/简体中文.json b/src/i18n/简体中文.json index a00a97e..2dc53e9 100644 --- a/src/i18n/简体中文.json +++ b/src/i18n/简体中文.json @@ -13,7 +13,8 @@ "ui.button.startProxy": "代理模式", "ui.button.solution": "解决办法", "ui.button.cacheFolder": "打开网页缓存文件夹", - "ui.button.copyUrl": "复制URL", + "ui.button.copyUrl": "复制网页链接", + "ui.button.copyApiUrl": "复制API链接", "ui.select.newAccount": "新账号", "ui.hint.newAccount": "从其它账号导出数据", "ui.hint.init": "请先在游戏里打开任意一个抽卡记录后再点击“加载数据”按钮", @@ -103,6 +104,7 @@ "uigf.fileType":"统一可交换抽卡记录标准 v4.0, v4.1", "ui.extra.cacheClean": "1. 确认是否已经打开游戏内的抽卡历史记录,如果仍然出现“身份认证已过期”的错误,再尝试下面的步骤\n2. 关闭绝区零的游戏窗口\n3. 点击上方的“打开缓存文件夹”按钮,打开Cache文件夹\n4. 删除Cache_Data文件夹\n5. 启动绝区零游戏,打开游戏内抽卡历史记录页面\n6. 关闭这个对话框,再点击“更新数据”按钮", "ui.extra.findCacheFolder": "如果点“打开缓存文件夹”按钮没有反应,可以手动找到游戏的网页缓存文件夹,目录为“你的游戏安装路径/ZenlessZoneZero_Data/webCaches/Cache/”", - "ui.extra.urlCopied": "URL已复制", + "ui.extra.urlCopied": "网页链接已复制", + "ui.extra.apiUrlCopied": "API链接已复制", "ui.uigf.title": "请选择要导出的UID" } diff --git a/src/i18n/繁體中文.json b/src/i18n/繁體中文.json index 44d2e33..860df65 100644 --- a/src/i18n/繁體中文.json +++ b/src/i18n/繁體中文.json @@ -13,7 +13,8 @@ "ui.button.startProxy": "代理模式", "ui.button.solution": "解決辦法", "ui.button.cacheFolder": "打開網頁緩存文件夾", - "ui.button.copyUrl": "復製URL", + "ui.button.copyUrl": "復製網頁鏈接", + "ui.button.copyApiUrl": "復製API鏈接", "ui.select.newAccount": "新賬號", "ui.hint.newAccount": "從其它賬號導出數據", "ui.hint.init": "請先在遊戲裏打開任意一個抽卡記錄後再點擊「加載數據」按鈕", @@ -102,6 +103,7 @@ "uigf.fileType":"統一可交換抽卡記錄標準 v4.0, v4.1", "ui.extra.cacheClean": "1. 確認是否已經打開遊戲內的抽卡歷史記錄,如果仍然出現「身份認證已過期」的錯誤,再嘗試下面的步驟\n2. 關閉絕區零的遊戲窗口\n3. 點擊上方的「打開緩存文件夾」按鈕,打開Cache文件夾\n4. 刪除Cache_Data文件夾\n5. 啟動絕區零遊戲,打開遊戲內抽卡歷史記錄頁面\n6. 關閉這個對話框,再點擊「更新數據」按鈕", "ui.extra.findCacheFolder": "如果點「打開緩存文件夾」按鈕沒有反應,可以手動找到遊戲的網頁緩存文件夾,目錄為「你的遊戲安裝路徑/ZenlessZoneZero_Data/webCaches/Cache/」", - "ui.extra.urlCopied": "URL已復製", + "ui.extra.urlCopied": "網頁鏈接已復製", + "ui.extra.apiUrlCopied": "API鏈接已復製", "ui.uigf.title": "請選擇要導出的UID" } diff --git a/src/main/bridge.js b/src/main/bridge.js index b19ace3..aa318d0 100644 --- a/src/main/bridge.js +++ b/src/main/bridge.js @@ -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) }) \ No newline at end of file diff --git a/src/main/getData.js b/src/main/getData.js index 0416a56..f73fe14 100644 --- a/src/main/getData.js +++ b/src/main/getData.js @@ -408,6 +408,17 @@ const getUrl = async () => { return url } +const getApiUrl = async () => { + const url = await getUrl() + if (!url) return null + + const searchParams = getQuerystring(url) + if (!searchParams) return null + + const apiUrl = `${apiDomain}/common/gacha_record/api/getGachaLog?${searchParams.toString()}` + return apiUrl +} + const fetchData = async (urlOverride) => { const text = i18n.log await readData() @@ -558,4 +569,5 @@ exports.getUrl = getUrl exports.deleteData = deleteData exports.saveData = saveData exports.changeCurrent = changeCurrent -exports.convertTimeZone = convertTimeZone \ No newline at end of file +exports.convertTimeZone = convertTimeZone +exports.getApiUrl = getApiUrl \ No newline at end of file diff --git a/src/renderer/App.vue b/src/renderer/App.vue index c38dae9..82d7ab1 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -2,81 +2,221 @@
{{hint}}
+ {{ hint
+ }}
{{typeMap.get(item[0])}}
-+ {{ typeMap.get(item[0]) }} +
+{{ui.urlDialog.hint}}
-{{ ui.urlDialog.hint }}
+{{ txt }}
-{{ui.extra.findCacheFolder}}
+{{ ui.extra.findCacheFolder }}