可切換內網訪問
This commit is contained in:
1 parent
1ff69f3cb3
commit
fd67fa8f63
10 files changed
+493
-40
No files matched your search
@@ -7,8 +7,9 @@ import type { LoginProfile } from "@/data/auto/loginProfile";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { useLocale } from "uview-pro";
|
||||
import { computed, ref } from "vue";
|
||||
import { apiBaseUrl } from "@/common/apiEndpoint";
|
||||
import { brandGlyph, veinGlyph } from "@/common/brand";
|
||||
import { backendLocale, baseUrl } from "@/common/http.interceptor";
|
||||
import { backendLocale } from "@/common/http.interceptor";
|
||||
import { DEFAULT_LOCALE, setCurrentUiLocale } from "@/common/locale-const";
|
||||
import { encryptLoginPassword } from "@/common/pwd-crypto";
|
||||
import { useThemeGradient, useThemeTokens } from "@/composables";
|
||||
@@ -65,6 +66,8 @@ setCurrentUiLocale(currentLocale.value?.name ?? DEFAULT_LOCALE);
|
||||
/** 非发布构建才显示「当前环境 + 实际调用的后端地址」:发布版 import.meta.env.PROD 为 true,整行编译期即被剔除 */
|
||||
const isProd = import.meta.env.PROD;
|
||||
const envMode = import.meta.env.MODE;
|
||||
/** 当前后端地址:跟随「我的 → 访问线路」切换(内网直连时显示内网地址) */
|
||||
const currentApiUrl = apiBaseUrl();
|
||||
function toggleLang() {
|
||||
const next = isZh.value ? "en-US" : "zh-CN";
|
||||
setLocale(next);
|
||||
@@ -191,7 +194,7 @@ async function handleLogin() {
|
||||
</text>
|
||||
</view>
|
||||
<view v-if="!isProd" class="login-env">
|
||||
{{ envMode }} · {{ baseUrl }}
|
||||
{{ envMode }} · {{ currentApiUrl }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in new issue
Block a user