mirror of
https://github.com/earthjasonlin/zzz-signal-search-export.git
synced 2025-04-19 15:10:17 +08:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
82f42e56db | |||
a2dcda6be0 | |||
dcaad1d544 | |||
69042728da | |||
0103a0fb4b |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "star-rail-warp-export",
|
||||
"version": "0.0.14",
|
||||
"version": "0.0.17",
|
||||
"main": "./dist/electron/main/main.js",
|
||||
"author": "biuuu <https://github.com/biuuu>",
|
||||
"license": "MIT",
|
||||
|
275
src/gachaType.json
Normal file
275
src/gachaType.json
Normal file
@ -0,0 +1,275 @@
|
||||
[
|
||||
[
|
||||
"de-de",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "Figuren-Aktionswarp"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "Lichtkegel-Aktionswarp"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "Standardwarp"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "Einsteigerwarp"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"ru-ru",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "Прыжок события: Персонаж"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "Прыжок события: Световой конус"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "Стандартный прыжок"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "Прыжок новичка"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"th-th",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "กิจกรรมวาร์ปตัวละคร"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "กิจกรรมวาร์ป Light Cone"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "วาร์ปถาวร"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "วาร์ปสำหรับมือใหม่"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"zh-cn",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "角色活动跃迁"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "光锥活动跃迁"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "常驻跃迁"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "新手跃迁"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"zh-tw",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "角色活動躍遷"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "光錐活動躍遷"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "常駐躍遷"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "新手躍遷"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"en-us",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "Character Event Warp"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "Light Cone Event Warp"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "Regular Warp"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "Starter Warp"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"es-es",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "Salto de evento de personaje"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "Salto de evento de cono de luz"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "Salto normal"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "Salto de principiante"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"fr-fr",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "Saut hyperespace événement de personnage"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "Saut hyperespace événement de cônes de lumière"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "Saut hyperespace classique"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "Saut hyperespace de départ"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"id-id",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "Event Warp Karakter"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "Event Warp Light Cone"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "Warp Reguler"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "Warp Pemula"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"ja-jp",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "イベント跳躍・キャラクター"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "イベント跳躍・光円錐"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "恒常跳躍"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "初心者跳躍"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"ko-kr",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "캐릭터 이벤트 워프"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "광추 이벤트 워프"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "상시 워프"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "초보자 워프"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"pt-pt",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "Salto Hiperespacial de Evento de Personagem"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "Salto Hiperespacial de Evento de Cone de Luz"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "Salto Hiperespacial Permanente"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "Salto Hiperespacial Inicial"
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"vi-vn",
|
||||
[
|
||||
{
|
||||
"key": "11",
|
||||
"name": "Bước Nhảy Sự Kiện Nhân Vật"
|
||||
},
|
||||
{
|
||||
"key": "12",
|
||||
"name": "Bước Nhảy Sự Kiện Nón Ánh Sáng"
|
||||
},
|
||||
{
|
||||
"key": "1",
|
||||
"name": "Bước Nhảy Vĩnh Viễn"
|
||||
},
|
||||
{
|
||||
"key": "2",
|
||||
"name": "Bước Nhảy Tân Thủ"
|
||||
}
|
||||
]
|
||||
]
|
||||
]
|
@ -10,6 +10,7 @@
|
||||
"ui.button.startProxy": "Proxy mode",
|
||||
"ui.button.solution": "Solution",
|
||||
"ui.button.cacheFolder": "Open cache folder",
|
||||
"ui.button.copyUrl": "Copy 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",
|
||||
@ -42,7 +43,7 @@
|
||||
"ui.setting.seaServer": "Global server",
|
||||
"ui.setting.logTypeHint": "Choose which server generated logs to be used first when acquiring URL from game logs",
|
||||
"ui.setting.autoUpdate": "Auto update",
|
||||
"ui.setting.hideNovice": "Hide Departure Warp",
|
||||
"ui.setting.hideNovice": "Hide Starter Warp",
|
||||
"ui.setting.proxyMode": "Proxy mode",
|
||||
"ui.setting.proxyModeHint": "When we fail to get the URL from system logs, use the system proxy",
|
||||
"ui.setting.fetchFullHistory": "Get complete data",
|
||||
@ -84,5 +85,6 @@
|
||||
"excel.filePrefix": "Star Rail Warp logger",
|
||||
"excel.fileType": "Excel file",
|
||||
"ui.extra.cacheClean": "1. Confirm whether the warp 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 Star Rail \n3. Click the \"Open Web Cache Folder\" button above to open the \"Cache\" folder \n4. Delete the \"Cache_ Data\" folder \n5. Start the Star Rail game and open the warp 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/Star Rail/Games/StarRail_Data/webCaches/Cache/\""
|
||||
"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/Star Rail/Games/StarRail_Data/webCaches/Cache/\"",
|
||||
"ui.extra.urlCopied": "URL Copied"
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
"ui.button.startProxy": "代理模式",
|
||||
"ui.button.solution": "解决办法",
|
||||
"ui.button.cacheFolder": "打开网页缓存文件夹",
|
||||
"ui.button.copyUrl": "复制URL",
|
||||
"ui.select.newAccount": "新账号",
|
||||
"ui.hint.newAccount": "从其它账号导出数据",
|
||||
"ui.hint.init": "请先在游戏里打开任意一个抽卡记录后再点击“加载数据”按钮",
|
||||
@ -42,7 +43,7 @@
|
||||
"ui.setting.seaServer": "外服",
|
||||
"ui.setting.logTypeHint": "使用游戏日志获取URL时,优先选择哪种服务器生成的日志文件。",
|
||||
"ui.setting.autoUpdate": "自动更新",
|
||||
"ui.setting.hideNovice": "隐藏始发跃迁",
|
||||
"ui.setting.hideNovice": "隐藏新手跃迁",
|
||||
"ui.setting.proxyMode": "代理模式",
|
||||
"ui.setting.proxyModeHint": "通过设置系统代理来获取URL,无法从日志中获取到有效的URL时才会启动代理服务器。",
|
||||
"ui.setting.fetchFullHistory": "获取完整数据",
|
||||
@ -84,5 +85,6 @@
|
||||
"excel.filePrefix": "星穹铁道跃迁记录",
|
||||
"excel.fileType": "Excel文件",
|
||||
"ui.extra.cacheClean": "1. 确认是否已经打开游戏内的抽卡历史记录,如果仍然出现“身份认证已过期”的错误,再尝试下面的步骤\n2. 关闭星穹铁道的游戏窗口\n3. 点击上方的“打开缓存文件夹”按钮,打开Cache文件夹\n4. 删除Cache_Data文件夹\n5. 启动星穹铁道游戏,打开游戏内抽卡历史记录页面\n6. 关闭这个对话框,再点击“更新数据”按钮",
|
||||
"ui.extra.findCacheFolder": "如果点“打开缓存文件夹”按钮没有反应,可以手动找到游戏的网页缓存文件夹,目录为“你的游戏安装路径/Star Rail/Game/StarRail_Data/webCaches/Cache/”"
|
||||
"ui.extra.findCacheFolder": "如果点“打开缓存文件夹”按钮没有反应,可以手动找到游戏的网页缓存文件夹,目录为“你的游戏安装路径/Star Rail/Game/StarRail_Data/webCaches/Cache/”",
|
||||
"ui.extra.urlCopied": "URL已复制"
|
||||
}
|
||||
|
@ -42,7 +42,7 @@
|
||||
"ui.setting.seaServer": "國際服",
|
||||
"ui.setting.logTypeHint": "使用遊戲記錄取得 URL 時,優先選擇哪種伺服器產生的記錄檔案。",
|
||||
"ui.setting.autoUpdate": "自動更新",
|
||||
"ui.setting.hideNovice": "隱藏始發躍遷",
|
||||
"ui.setting.hideNovice": "隱藏新手躍遷",
|
||||
"ui.setting.proxyMode": "Proxy 模式",
|
||||
"ui.setting.proxyModeHint": "透過設定系統 Proxy 以取得 URL,將會在從系統記錄中取得 URL 失敗時啟動。",
|
||||
"ui.setting.fetchFullHistory": "取得完整資料",
|
||||
|
11
src/main/bridge.js
Normal file
11
src/main/bridge.js
Normal file
@ -0,0 +1,11 @@
|
||||
const { clipboard, ipcMain } = require('electron')
|
||||
const { getUrl } = require('./getData')
|
||||
|
||||
ipcMain.handle('COPY_URL', async () => {
|
||||
const url = await getUrl()
|
||||
if (url) {
|
||||
clipboard.writeText(url)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
@ -9,6 +9,7 @@ const i18n = require('./i18n')
|
||||
const { enableProxy, disableProxy } = require('./module/system-proxy')
|
||||
const mitmproxy = require('./module/node-mitmproxy')
|
||||
const { mergeData } = require('./utils/mergeData')
|
||||
const gachaTypeRaw = require('../gachaType.json')
|
||||
|
||||
const dataMap = new Map()
|
||||
const order = ['11', '12', '1', '2']
|
||||
@ -17,7 +18,6 @@ let apiDomain = 'https://api-takumi.mihoyo.com'
|
||||
const saveData = async (data, url) => {
|
||||
const obj = Object.assign({}, data)
|
||||
obj.result = [...obj.result]
|
||||
obj.typeMap = [...obj.typeMap]
|
||||
await config.save()
|
||||
await saveJSON(`gacha-list-${data.uid}.json`, obj)
|
||||
}
|
||||
@ -25,8 +25,8 @@ const saveData = async (data, url) => {
|
||||
const defaultTypeMap = new Map([
|
||||
['11', '角色活动跃迁'],
|
||||
['12', '光锥活动跃迁'],
|
||||
['1', '群星跃迁'],
|
||||
['2', '始发跃迁']
|
||||
['1', '常驻跃迁'],
|
||||
['2', '新手跃迁']
|
||||
])
|
||||
|
||||
const findDataFiles = async (dataPath, fileMap) => {
|
||||
@ -163,7 +163,7 @@ const getGachaLog = async ({ key, page, name, retryCount, url, endId }) => {
|
||||
const text = i18n.log
|
||||
try {
|
||||
const res = await request(`${url}&gacha_type=${key}&page=${page}&size=${20}${endId ? '&end_id=' + endId : ''}`)
|
||||
return res.data.list
|
||||
return res?.data
|
||||
} catch (e) {
|
||||
if (retryCount) {
|
||||
sendMsg(i18n.parse(text.fetch.retry, { name, page, count: 6 - retryCount }))
|
||||
@ -181,7 +181,8 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
||||
const text = i18n.log
|
||||
let page = 1
|
||||
let list = []
|
||||
let res = []
|
||||
let res = null
|
||||
let logs = []
|
||||
let uid = ''
|
||||
let region = ''
|
||||
let region_time_zone = ''
|
||||
@ -195,8 +196,9 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
||||
sendMsg(i18n.parse(text.fetch.current, { name, page }))
|
||||
res = await getGachaLog({ key, page, name, url, endId, retryCount: 5 })
|
||||
await sleep(0.3)
|
||||
if (!uid && res.length) {
|
||||
uid = res[0].uid
|
||||
logs = res?.list || []
|
||||
if (!uid && logs.length) {
|
||||
uid = logs[0].uid
|
||||
}
|
||||
if (!region) {
|
||||
region = res.region
|
||||
@ -204,14 +206,14 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
||||
if (!region_time_zone) {
|
||||
region_time_zone = res.region_time_zone
|
||||
}
|
||||
list.push(...res)
|
||||
list.push(...logs)
|
||||
page += 1
|
||||
|
||||
if (res.length) {
|
||||
endId = res[res.length - 1].id
|
||||
if (logs.length) {
|
||||
endId = logs[logs.length - 1].id
|
||||
}
|
||||
|
||||
if (!config.fetchFullHistory && res.length && uid && dataMap.has(uid)) {
|
||||
if (!config.fetchFullHistory && logs.length && uid && dataMap.has(uid)) {
|
||||
const result = dataMap.get(uid).result
|
||||
if (result.has(key)) {
|
||||
const arr = result.get(key)
|
||||
@ -219,7 +221,7 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
||||
const localLatestId = arr[arr.length - 1].id
|
||||
if (localLatestId) {
|
||||
let shouldBreak = false
|
||||
res.forEach(item => {
|
||||
logs.forEach(item => {
|
||||
if (item.id === localLatestId) {
|
||||
shouldBreak = true
|
||||
}
|
||||
@ -231,7 +233,7 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (res.length > 0)
|
||||
} while (logs.length > 0)
|
||||
return { list, uid, region, region_time_zone }
|
||||
}
|
||||
|
||||
@ -263,7 +265,7 @@ const tryGetUid = async (queryString) => {
|
||||
return config.current
|
||||
}
|
||||
|
||||
const gachaTypeMap = new Map(JSON.parse('[["de-de",[{"key":"11","name":"Figuren-Aktionswarp"},{"key":"12","name":"Lichtkegel-Aktionswarp"},{"key":"1","name":"Stellarwarp"},{"key":"2","name":"Startwarp"}]],["ru-ru",[{"key":"11","name":"Прыжок события: Персонаж"},{"key":"12","name":"Прыжок события: Световой конус"},{"key":"1","name":"Звёздный Прыжок"},{"key":"2","name":"Отправной Прыжок"}]],["th-th",[{"key":"11","name":"กิจกรรมวาร์ปตัวละคร"},{"key":"12","name":"กิจกรรมวาร์ป Light Cone"},{"key":"1","name":"วาร์ปสู่ดวงดาว"},{"key":"2","name":"ก้าวแรกแห่งการวาร์ป"}]],["zh-cn",[{"key":"11","name":"角色活动跃迁"},{"key":"12","name":"光锥活动跃迁"},{"key":"1","name":"群星跃迁"},{"key":"2","name":"始发跃迁"}]],["zh-tw",[{"key":"11","name":"角色活動躍遷"},{"key":"12","name":"光錐活動躍遷"},{"key":"1","name":"群星躍遷"},{"key":"2","name":"始發躍遷"}]],["en-us",[{"key":"11","name":"Character Event Warp"},{"key":"12","name":"Light Cone Event Warp"},{"key":"1","name":"Stellar Warp"},{"key":"2","name":"Departure Warp"}]],["es-es",[{"key":"11","name":"Salto de evento de personaje"},{"key":"12","name":"Salto de evento de cono de luz"},{"key":"1","name":"Salto estelar"},{"key":"2","name":"Salto de partida"}]],["fr-fr",[{"key":"11","name":"Saut hyperespace événement de personnage"},{"key":"12","name":"Saut hyperespace événement de cônes de lumière"},{"key":"1","name":"Saut stellaire"},{"key":"2","name":"Saut hyperespace de départ"}]],["id-id",[{"key":"11","name":"Event Warp Karakter"},{"key":"12","name":"Event Warp Light Cone"},{"key":"1","name":"Warp Bintang-Bintang"},{"key":"2","name":"Warp Keberangkatan"}]],["ja-jp",[{"key":"11","name":"イベント跳躍・キャラクター"},{"key":"12","name":"イベント跳躍・光円錐"},{"key":"1","name":"群星跳躍"},{"key":"2","name":"始発跳躍"}]],["ko-kr",[{"key":"11","name":"캐릭터 이벤트 워프"},{"key":"12","name":"광추 이벤트 워프"},{"key":"1","name":"뭇별의 워프"},{"key":"2","name":"초행길 워프"}]],["pt-pt",[{"key":"11","name":"Salto Hiperespacial de Evento de Personagem"},{"key":"12","name":"Salto Hiperespacial de Evento de Cone de Luz"},{"key":"1","name":"Salto Hiperespacial Estelar"},{"key":"2","name":"Salto Hiperespacial de Novatos"}]],["vi-vn",[{"key":"11","name":"Bước Nhảy Sự Kiện Nhân Vật"},{"key":"12","name":"Bước Nhảy Sự Kiện Nón Ánh Sáng"},{"key":"1","name":"Bước Nhảy Chòm Sao"},{"key":"2","name":"Bước Nhảy Đầu Tiên"}]]]'))
|
||||
const gachaTypeMap = new Map(gachaTypeRaw)
|
||||
const getGachaType = (lang) => {
|
||||
const locale = detectLocale(lang)
|
||||
return gachaTypeMap.get(locale || lang)
|
||||
@ -426,7 +428,7 @@ const fetchData = async (urlOverride) => {
|
||||
originTimeZone = region_time_zone
|
||||
}
|
||||
}
|
||||
const data = { result, time: Date.now(), typeMap, uid: originUid, lang, region: originRegion, region_time_zone: originTimeZone }
|
||||
const data = { result, typeMap, time: Date.now(), uid: originUid, lang, region: originRegion, region_time_zone: originTimeZone }
|
||||
const localData = dataMap.get(originUid)
|
||||
const mergedResult = mergeData(localData, data)
|
||||
data.result = mergedResult
|
||||
@ -506,3 +508,5 @@ exports.getData = () => {
|
||||
current: config.current
|
||||
}
|
||||
}
|
||||
|
||||
exports.getUrl = getUrl
|
||||
|
@ -2,6 +2,7 @@ const { app, BrowserWindow, ipcMain } = require('electron')
|
||||
const { initWindow } = require('./utils')
|
||||
const { disableProxy, proxyStatus } = require('./module/system-proxy')
|
||||
require('./getData')
|
||||
require('./bridge')
|
||||
require('./excel')
|
||||
require('./UIGFJson')
|
||||
const { getUpdateInfo } = require('./update/index')
|
||||
|
@ -26,6 +26,7 @@
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="setting" icon="setting">{{ui.button.setting}}</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="!allowClick() || state.status === 'loading'" command="url" icon="link">{{ui.button.url}}</el-dropdown-item>
|
||||
<el-dropdown-item command="copyUrl" icon="DocumentCopy">{{ui.button.copyUrl}}</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="!allowClick() || state.status === 'loading'" command="proxy" icon="position">{{ui.button.startProxy}}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
@ -79,6 +80,8 @@ import GachaDetail from './components/GachaDetail.vue'
|
||||
import Setting from './components/Setting.vue'
|
||||
import gachaDetail from './gachaDetail'
|
||||
import { version } from '../../package.json'
|
||||
import gachaType from '../gachaType.json'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const state = reactive({
|
||||
status: 'init',
|
||||
@ -158,11 +161,19 @@ const detail = computed(() => {
|
||||
})
|
||||
|
||||
const typeMap = computed(() => {
|
||||
const data = state.dataMap.get(state.current)
|
||||
return data.typeMap
|
||||
const gachaTypeMap = new Map(gachaType)
|
||||
const type = gachaTypeMap.get(state.config.lang)
|
||||
const result = new Map()
|
||||
if (type) {
|
||||
for (let { key, name } of type) {
|
||||
result.set(key, name)
|
||||
}
|
||||
}
|
||||
return result
|
||||
})
|
||||
|
||||
const fetchData = async (url) => {
|
||||
state.log = ''
|
||||
state.status = 'loading'
|
||||
const data = await ipcRenderer.invoke('FETCH_DATA', url)
|
||||
if (data) {
|
||||
@ -240,6 +251,8 @@ const optionCommand = (type) => {
|
||||
state.showUrlDlg = true
|
||||
} else if (type === 'proxy') {
|
||||
fetchData('proxy')
|
||||
} else if (type === 'copyUrl') {
|
||||
copyUrl()
|
||||
}
|
||||
}
|
||||
|
||||
@ -251,6 +264,15 @@ const updateConfig = async () => {
|
||||
state.config = await ipcRenderer.invoke('GET_CONFIG')
|
||||
}
|
||||
|
||||
const copyUrl = async () => {
|
||||
const successed = await ipcRenderer.invoke('COPY_URL')
|
||||
if (successed) {
|
||||
ElMessage.success(ui.value.extra.urlCopied)
|
||||
} else {
|
||||
ElMessage.error(state.i18n.log.url.notFound)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await readData()
|
||||
await getI18nData()
|
||||
|
Reference in New Issue
Block a user