From d0325e5b4483084336e2e4f99a391d2f59f55549 Mon Sep 17 00:00:00 2001 From: kerms Date: Mon, 28 Apr 2025 14:41:44 +0200 Subject: [PATCH] feat(env) add trial msg --- src/App.vue | 4 ++-- src/composables/buildMode.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 51e1df3..627b695 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,7 +10,7 @@ import type {ControlMsg, ServerMsg} from "@/api"; import {ControlEvent, ControlMsgType} from "@/api"; import {routeCtrlMsg, routeModuleServerMsg} from "@/router/msgRouter"; import {globalNotify} from "@/composables/notification"; -import {getTrialDate, isDevMode, isOTAEnabled, isTrialMode} from "@/composables/buildMode"; +import {getTrialDate, getTrialMsg, isDevMode, isOTAEnabled, isTrialMode} from "@/composables/buildMode"; import {useSystemModule} from "@/composables/useSystemModule"; import {useDataFlowModule} from "@/composables/useDataFlowModule"; import {useUpdateModule} from "@/composables/useUpdateModule"; @@ -61,7 +61,7 @@ onMounted(() => { } if (isTrialMode()) { - ElMessageBox.alert('感谢您试用串口透传固件,如果觉得好用,可购买标准版支持我,谢谢!', getTrialDate(), { + ElMessageBox.alert(getTrialMsg(), getTrialDate(), { confirmButtonText: '好的', }); } diff --git a/src/composables/buildMode.ts b/src/composables/buildMode.ts index 9101a07..19cecdc 100644 --- a/src/composables/buildMode.ts +++ b/src/composables/buildMode.ts @@ -13,3 +13,7 @@ export function isTrialMode() { export function getTrialDate() { return import.meta.env.VITE_TRIAL_DATE || "1970-01-01"; } + +export function getTrialMsg() { + return import.meta.env.VITE_TRIAL_MSG || "感谢您试用允斯开放固件,若您喜欢,欢迎关注我的B站或者加入允斯群,新项目和更新都会在第一时间在这里发布. 使用愉快^_^"; +}