From 604729f79ed24e19d51b9dcc308ebb9a0bd3e8ac Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 19 Dec 2024 11:08:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(X-Pack):=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=A2=9E=E5=8A=A0=E5=AF=86=E7=A0=81=E9=99=90?= =?UTF-8?q?=E5=88=B6=E6=9C=BA=E5=88=B6=20#14147?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/mobile/login/index.vue | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/core-frontend/src/views/mobile/login/index.vue b/core/core-frontend/src/views/mobile/login/index.vue index 9fd471204a..73b35bb238 100644 --- a/core/core-frontend/src/views/mobile/login/index.vue +++ b/core/core-frontend/src/views/mobile/login/index.vue @@ -16,6 +16,7 @@ import { rsaEncryp } from '@/utils/encryption' import VanForm from 'vant/es/form' import VanField from 'vant/es/field' import VanButton from 'vant/es/button' +import { XpackComponent } from '@/components/plugin' import 'vant/es/button/style' import 'vant/es/toast/style' import 'vant/es/field/style' @@ -32,6 +33,9 @@ const username = ref('') const password = ref('') const duringLogin = ref(false) +const xpackLoadFail = ref(false) +const xpackInvalidPwd = ref() + const checkUsername = value => { if (!value) { return true @@ -75,6 +79,13 @@ loadAppearance() const handleBlur = () => { inputFocus.value = '' } + +const invalidPwdCb = val => { + duringLogin.value = !!val + if (val) { + router.push({ path: '/index' }) + } +} const onSubmit = async () => { if (!checkUsername(username.value) || !validatePwd(password.value)) { showToast({ @@ -97,6 +108,13 @@ const onSubmit = async () => { userStore.setToken(token) userStore.setExp(exp) userStore.setTime(Date.now()) + if (!xpackLoadFail.value && xpackInvalidPwd.value?.invokeMethod) { + const param = { + methodName: 'init' + } + xpackInvalidPwd?.value.invokeMethod(param) + return + } router.push({ path: '/index' }) }) .catch(() => { @@ -170,6 +188,12 @@ const usernameEndValidate = ({ status, message }) => { +