mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
♻️ 通过 import.meta 获取当前环境
This commit is contained in:
@@ -107,7 +107,7 @@
|
||||
<v-list-subheader :inset="true" class="config-header" title="调试" />
|
||||
<v-divider :inset="true" class="border-opacity-75" />
|
||||
<v-list-item
|
||||
v-if="appStore.devEnv"
|
||||
v-if="isDevEnv"
|
||||
title="调试模式"
|
||||
subtitle="开启后将显示调试信息"
|
||||
prepend-icon="mdi-bug-play"
|
||||
@@ -176,6 +176,8 @@ const userStore = useUserStore();
|
||||
const homeStore = useHomeStore();
|
||||
const achievementsStore = useAchievementsStore();
|
||||
|
||||
const isDevEnv = ref<boolean>(!import.meta?.env?.PROD);
|
||||
|
||||
// About App
|
||||
const versionApp = ref<string>("");
|
||||
const versionTauri = ref<string>("");
|
||||
|
||||
@@ -49,10 +49,9 @@ function readLoading(): void {
|
||||
onMounted(async () => {
|
||||
loadingTitle.value = "正在加载首页";
|
||||
loading.value = true;
|
||||
const isProdEnv = import.meta?.env?.PROD;
|
||||
// 获取当前环境
|
||||
const timeGet = getBuildTime();
|
||||
appStore.devEnv = timeGet.startsWith("dev");
|
||||
if (!appStore.devEnv && appStore.devMode) {
|
||||
if (isProdEnv && appStore.devMode) {
|
||||
appStore.devMode = false;
|
||||
}
|
||||
const showItems = homeStore.getShowValue();
|
||||
@@ -71,7 +70,7 @@ onMounted(async () => {
|
||||
}),
|
||||
);
|
||||
timer.value = setInterval(readLoading, 100);
|
||||
if (appStore.buildTime !== getBuildTime() && !appStore.devEnv) {
|
||||
if (appStore.buildTime !== getBuildTime() && isProdEnv) {
|
||||
const confirm = await showConfirm({
|
||||
title: "检测到版本更新",
|
||||
text: "请到设置页手动更新版本,即将弹出更新说明子页面",
|
||||
|
||||
Reference in New Issue
Block a user