From dbf5a402a6ba58fdb8ab331511585b0cbb3d1938 Mon Sep 17 00:00:00 2001 From: hwj Date: Fri, 5 Jun 2026 18:26:30 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E7=99=BB=E5=BD=95=E9=A1=B5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0logo=E9=95=BF=E6=8C=89=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login.vue | 59 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/src/pages/login.vue b/src/pages/login.vue index 8673102..ef20bea 100644 --- a/src/pages/login.vue +++ b/src/pages/login.vue @@ -3,7 +3,7 @@ - + @@ -38,6 +38,20 @@ + + + + @@ -45,12 +59,16 @@ import modal from '@/plugins/modal' import { getCodeImg } from '@/api/login' import { computed, ref } from "vue"; +import { useI18n } from 'vue-i18n' import config from '@/config.js' import useUserStore from '@/store/modules/user' import NavBar from '@/components/common/NavBar.vue' import { getFirstTabBarPath } from '@/utils/permissionMenu' +import { SERVER_BASE_URL_STORAGE_KEY, getBaseUrl } from '@/utils/request' +import { removeToken } from '@/utils/auth' const userStore = useUserStore() +const { t } = useI18n() const codeUrl = ref(""); const captchaEnabled = ref(false); const statusBarHeight = ref(uni.getSystemInfoSync?.().statusBarHeight || 0) @@ -66,6 +84,43 @@ const loginForm = ref({ uuid: '' }); +const serverPopup = ref(null) +const serverAddress = ref(getBaseUrl()) + +function onLogoLongPress() { + setTimeout(() => { + uni.hideToast() + uni.vibrateShort() + serverPopup.value?.open() + }, 2000) +} + +function handleServerAddressSave(value) { + const nextAddress = value.trim() + if (!nextAddress) { + uni.showToast({ + title: t('setting.serverAddressRequired'), + icon: 'none', + duration: 1500 + }) + return false + } + uni.setStorageSync(SERVER_BASE_URL_STORAGE_KEY, nextAddress) + serverAddress.value = nextAddress + uni.showToast({ + title: t('setting.serverAddressSaved'), + icon: 'none', + duration: 1200 + }) + removeToken() + setTimeout(() => { + uni.reLaunch({ + url: '/pages/login' + }) + }, 1200) + return true +} + function getCode() { getCodeImg().then(res => { captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled @@ -159,6 +214,8 @@ page { padding-top: 0; display: flex; justify-content: center; + position: relative; + z-index: 1; .logo-wrapper { width: 160rpx;