Skip to content

Commit ab9b49e

Browse files
committed
fix(webui): 将关注模块 Telegram 群入口改为 tg 深链跳转并修复依赖安全告警
- 将主页“关注模块”中的 Telegram 群按钮改为优先使用 tg://resolve?domain=device_faker 拉起 Telegram,保留 https://t.me/device_faker 网页兜底 - 调整外链打开逻辑,支持为特定入口传入 fallback URL,其余 QQ 群、仓库和作者链接保持原有行为 - 修复模板卡片、模板列表和模板页中的 3 处 Prettier 格式警告,恢复 lint 通过 - 执行 npm audit fix,更新 vite、lodash 和 lodash-es 的锁定版本,清除 3 个 high severity vulnerabilities
1 parent 05a904d commit ab9b49e

5 files changed

Lines changed: 31 additions & 16 deletions

File tree

webui/package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webui/src/components/templates/TemplateCard.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ import type { Template } from '../../types'
116116
117117
const props = defineProps<{ name: string; template: Template }>()
118118
const { name, template } = toRefs(props)
119-
const emit = defineEmits<{ export: [string, Template]; edit: [string, Template]; delete: [string] }>()
119+
const emit = defineEmits<{
120+
export: [string, Template]
121+
edit: [string, Template]
122+
delete: [string]
123+
}>()
120124
121125
const { t } = useI18n()
122126
</script>

webui/src/components/templates/TemplateList.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ import { useI18n } from '../../utils/i18n'
2727
import type { Template } from '../../types'
2828
2929
const props = defineProps<{ templates: Record<string, Template>; isSearching?: boolean }>()
30-
const emit = defineEmits<{ export: [string, Template]; edit: [string, Template]; delete: [string] }>()
30+
const emit = defineEmits<{
31+
export: [string, Template]
32+
edit: [string, Template]
33+
delete: [string]
34+
}>()
3135
3236
const { t } = useI18n()
3337

webui/src/pages/StatusPage.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@
131131
</span>
132132
<span>{{ t('status.follow.qq_group') }}</span>
133133
</button>
134-
<button class="community-link" type="button" @click="openExternalUrl(telegramUrl)">
134+
<button
135+
class="community-link"
136+
type="button"
137+
@click="openExternalUrl(telegramIntentUrl, telegramWebUrl)"
138+
>
135139
<span class="brand-logo telegram-logo" aria-hidden="true">
136140
<svg viewBox="0 0 24 24" role="img">
137141
<path :d="siTelegram.path" fill="currentColor" />
@@ -195,7 +199,8 @@ const followDialogVisible = ref(false)
195199
196200
const qqGroupUrl =
197201
'https://qun.qq.com/universal-share/share?ac=1&authKey=ls4nlfcsF%2Bxp5SPnVsXRgpbeV1axPZb%2FmJCMXms6ZCHjgAwvOyl1LV%2BDNVL1btgL&busi_data=eyJncm91cENvZGUiOiI4NTQxODgyNTIiLCJ0b2tlbiI6IlE1WVVyZTZxUXVjZUtGUUxWSGFmbzkvMEd3UWNRSiszdklTZDhHejU0RDRyT0lWRTFqS3d4UGJSM1ltaXpkS3MiLCJ1aW4iOiIxMTA1NzgzMDMzIn0%3D&data=IbvhTKt9HwCSsCsl_610-rQ8p6H2NgLmxhEKkMcn-BMWPb86jygWBZJfWLQGm7J8LwpVV2yhPafxTMXYGkjRVA&svctype=4&tempid=h5_group_info'
198-
const telegramUrl = 'https://t.me/device_faker'
202+
const telegramIntentUrl = 'tg://resolve?domain=device_faker'
203+
const telegramWebUrl = 'https://t.me/device_faker'
199204
const repositoryUrl = 'https://github.com/Seyud/device_faker'
200205
const authorGithubUrl = 'https://github.com/Seyud'
201206
@@ -219,13 +224,13 @@ function escapeShellArg(value: string) {
219224
return value.replace(/'/g, `'\\''`)
220225
}
221226
222-
async function openExternalUrl(url: string) {
227+
async function openExternalUrl(url: string, fallbackUrl: string = url) {
223228
try {
224229
await execCommand(
225230
`am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d '${escapeShellArg(url)}' >/dev/null 2>&1`
226231
)
227232
} catch {
228-
window.open(url, '_blank', 'noopener,noreferrer')
233+
window.open(fallbackUrl, '_blank', 'noopener,noreferrer')
229234
} finally {
230235
followDialogVisible.value = false
231236
}

webui/src/pages/TemplatePage.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ async function handleExport(name: string, template: Template) {
139139
const content = stringifyTemplatesToToml({ [name]: template })
140140
const copied = await copyTextToClipboard(content)
141141
toast(
142-
copied ? t('templates.messages.export_copy_success') : t('templates.messages.export_copy_failed')
142+
copied
143+
? t('templates.messages.export_copy_success')
144+
: t('templates.messages.export_copy_failed')
143145
)
144146
} catch (error) {
145147
console.error('Export template failed:', error)

0 commit comments

Comments
 (0)