🐛 修正isDevEnv判断逻辑

This commit is contained in:
BTMuli
2026-01-01 23:15:51 +08:00
parent 6d03c22b17
commit 03136c4864
4 changed files with 10 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/**
* Vue&Typescirpt 文件的 Eslint 配置
* Vue & Typescript 文件的 Eslint 配置
* @since Beta v0.9.1
*/
import pluginImport from "eslint-plugin-import";
@@ -47,7 +47,7 @@ const vueConfig = {
files: ["src/**/*.vue", "src/App.vue"],
plugins: { vue: pluginVue, import: pluginImport, prettier: pluginPrettier },
languageOptions: {
globals: { ...globals.browser, ...globals.es2021, TGApp: "readonly", window: "readonly" },
globals: { ...globals.browser, ...globals.es2021, TGApp: "readonly", window: "readonly", proEnv: "readonly" },
ecmaVersion: "latest",
sourceType: "module",
parser: parserVue,

View File

@@ -330,8 +330,8 @@ const userStore = useUserStore();
const { sidebar, theme, isLogin, recentNewsType, gameDir } = storeToRefs(useAppStore());
const { uid, briefInfo, cookie, account } = storeToRefs(userStore);
let themeListener: UnlistenFn | null = null;
// @ts-expect-error The import.meta meta-property is not allowed in files which will build into CommonJS output.
const isDevEnv = import.meta.env.MODE === "development";
const isDevEnv = proEnv.TAURI_ENV_DEBUG;
const showFollow = ref<boolean>();
const showLoginQr = ref<boolean>(false);
const isTryLogin = ref<boolean>(false);

5
src/vite-env.d.ts vendored
View File

@@ -51,3 +51,8 @@ declare type TauriProcessEnv = NodeJS.ProcessEnv & {
/** 平台类型,例如 `"desktop"`。 */
TAURI_PLATFORM_TYPE?: string;
};
/**
* ProcessEnv的转换
*/
declare const proEnv: TauriProcessEnv;

View File

@@ -14,6 +14,7 @@ const host = process.env.TAURI_DEV_HOST;
// https://vitejs.dev/config/
export default defineConfig({
define: { proEnv: process.env },
plugins: [
vue(),
vuetify(),