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 }) => { +