mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-15 03:53:16 +08:00
🐛 修正isDevEnv判断逻辑
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Vue&Typescirpt 文件的 Eslint 配置
|
* Vue & Typescript 文件的 Eslint 配置
|
||||||
* @since Beta v0.9.1
|
* @since Beta v0.9.1
|
||||||
*/
|
*/
|
||||||
import pluginImport from "eslint-plugin-import";
|
import pluginImport from "eslint-plugin-import";
|
||||||
@@ -47,7 +47,7 @@ const vueConfig = {
|
|||||||
files: ["src/**/*.vue", "src/App.vue"],
|
files: ["src/**/*.vue", "src/App.vue"],
|
||||||
plugins: { vue: pluginVue, import: pluginImport, prettier: pluginPrettier },
|
plugins: { vue: pluginVue, import: pluginImport, prettier: pluginPrettier },
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
globals: { ...globals.browser, ...globals.es2021, TGApp: "readonly", window: "readonly" },
|
globals: { ...globals.browser, ...globals.es2021, TGApp: "readonly", window: "readonly", proEnv: "readonly" },
|
||||||
ecmaVersion: "latest",
|
ecmaVersion: "latest",
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
parser: parserVue,
|
parser: parserVue,
|
||||||
|
|||||||
@@ -330,8 +330,8 @@ const userStore = useUserStore();
|
|||||||
const { sidebar, theme, isLogin, recentNewsType, gameDir } = storeToRefs(useAppStore());
|
const { sidebar, theme, isLogin, recentNewsType, gameDir } = storeToRefs(useAppStore());
|
||||||
const { uid, briefInfo, cookie, account } = storeToRefs(userStore);
|
const { uid, briefInfo, cookie, account } = storeToRefs(userStore);
|
||||||
let themeListener: UnlistenFn | null = null;
|
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 showFollow = ref<boolean>();
|
||||||
const showLoginQr = ref<boolean>(false);
|
const showLoginQr = ref<boolean>(false);
|
||||||
const isTryLogin = ref<boolean>(false);
|
const isTryLogin = ref<boolean>(false);
|
||||||
|
|||||||
5
src/vite-env.d.ts
vendored
5
src/vite-env.d.ts
vendored
@@ -51,3 +51,8 @@ declare type TauriProcessEnv = NodeJS.ProcessEnv & {
|
|||||||
/** 平台类型,例如 `"desktop"`。 */
|
/** 平台类型,例如 `"desktop"`。 */
|
||||||
TAURI_PLATFORM_TYPE?: string;
|
TAURI_PLATFORM_TYPE?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ProcessEnv的转换
|
||||||
|
*/
|
||||||
|
declare const proEnv: TauriProcessEnv;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const host = process.env.TAURI_DEV_HOST;
|
|||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
define: { proEnv: process.env },
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
vuetify(),
|
vuetify(),
|
||||||
|
|||||||
Reference in New Issue
Block a user