diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index 3369891608..a98074059e 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -428,7 +428,9 @@ export default { pwd_exp_tips: 'Password will expire in {0} days, please change your password as soon as possible', qr_code: 'QR Code', - platform_disable: '{0} setting disabled!' + platform_disable: '{0} setting disabled!', + input_account: 'Please enter account number', + redirect_2_auth: 'Redirecting to {0} authentication, {1} seconds...' }, component: { columnList: 'List item', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index 850200bed0..d9e64354ab 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -417,7 +417,9 @@ export default { pwd_invalid_error: '密碼已過期請聯系管理員修改或重置', pwd_exp_tips: '密碼在 {0} 天後過期,請盡快修改密碼', qr_code: '二維碼', - platform_disable: '{0}設置未開啟!' + platform_disable: '{0}設置未開啟!', + input_account: '請輸入賬號', + redirect_2_auth: '正在跳轉至 {0} 認證,{1} 秒...' }, component: { columnList: '列表項目', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 54c8140cd6..6d47eec6ed 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -418,7 +418,9 @@ export default { pwd_invalid_error: '密码已过期请联系管理员修改或重置', pwd_exp_tips: '密码在 {0} 天后过期,请尽快修改密码', qr_code: '二维码', - platform_disable: '{0}设置未开启!' + platform_disable: '{0}设置未开启!', + input_account: '请输入账号', + redirect_2_auth: '正在跳转至 {0} 认证,{1} 秒...' }, component: { columnList: '列表项', diff --git a/core/core-frontend/src/permission.ts b/core/core-frontend/src/permission.ts index edc7303037..7783acbdbe 100644 --- a/core/core-frontend/src/permission.ts +++ b/core/core-frontend/src/permission.ts @@ -54,7 +54,13 @@ router.beforeEach(async (to, from, next) => { isDesktop || (!isPlatformClient() && !isLarkPlatform()) ) { - window.location.href = window.origin + '/mobile.html#/index' + let pathname = window.location.pathname + pathname = pathname.substring(0, pathname.length - 1) + let url = window.origin + pathname + '/mobile.html#/index' + if (window.location.search) { + url += window.location.search + } + window.location.href = url } } await appearanceStore.setAppearance() diff --git a/core/core-frontend/src/utils/logout.ts b/core/core-frontend/src/utils/logout.ts index e46be09873..02ab17732c 100644 --- a/core/core-frontend/src/utils/logout.ts +++ b/core/core-frontend/src/utils/logout.ts @@ -26,11 +26,17 @@ export const logoutHandler = (justClean?: boolean) => { if (pathname) { if (pathname.includes('oidcbi/')) { pathname = pathname.replace('oidcbi/', '') + if (pathname.includes('mobile.html')) { + pathname = pathname.replace('mobile.html', '') + } pathname = pathname.substring(0, pathname.length - 1) window.location.href = pathname + '/oidcbi/oidc/logout' return } else if (pathname.includes('casbi/')) { pathname = pathname.replace('casbi/', '') + if (pathname.includes('mobile.html')) { + pathname = pathname.replace('mobile.html', '') + } pathname = pathname.substring(0, pathname.length - 1) const uri = window.location.href window.location.href = pathname + '/casbi/cas/logout?service=' + uri diff --git a/core/core-frontend/src/views/mobile/login/index.vue b/core/core-frontend/src/views/mobile/login/index.vue index 4e1dc75d3a..abc5b345ad 100644 --- a/core/core-frontend/src/views/mobile/login/index.vue +++ b/core/core-frontend/src/views/mobile/login/index.vue @@ -40,7 +40,8 @@ const xpackInvalidPwd = ref() const mfaRef = ref() const showMfa = ref(false) const mfaData = ref({ enabled: false, ready: false, uid: '', origin: 0 }) - +const loginType = ref('default') +const showPlatLoginMask = ref(true) const checkUsername = value => { if (!value) { return true @@ -122,12 +123,17 @@ const onSubmit = async () => { const res = await queryDekey() wsCache.set(appStore.getDekey, res.data) } - const param = { name: rsaEncryp(name), pwd: rsaEncryp(pwd) } + const isLdap = loginType.value === 'ldap' + const param = { + name: rsaEncryp(name), + pwd: rsaEncryp(pwd), + origin: isLdap ? 1 : 0 + } duringLogin.value = true loginApi(param) .then(res => { const { token, exp, mfa } = res.data - if (!xpackLoadFail.value && xpackInvalidPwd.value?.invokeMethod) { + if (!isLdap && !xpackLoadFail.value && xpackInvalidPwd.value?.invokeMethod) { const param = { methodName: 'init', args: res.data @@ -136,7 +142,7 @@ const onSubmit = async () => { return } showMfa.value = false - if (mfa?.enabled) { + if (!isLdap && mfa?.enabled) { for (const key in mfa) { mfaData.value[key] = mfa[key] } @@ -164,21 +170,40 @@ const passwordEndValidate = ({ status, message }) => { const usernameEndValidate = ({ status, message }) => { usernameError.value = status === 'passed' ? '' : message } +const switchType = type => { + loginType.value = type +} +const toMain = () => { + router.push({ path: '/index' }) +} +const loadFail = () => { + xpackLoadFail.value = true + showPlatLoginMask.value = false +} + - {{ t('login.account_login') }} + + {{ loginType === 'ldap' ? t('login.ldap_login') : t('login.account_login') }} + { 登录 - + (xpackLoadFail = true)" + @load-fail="() => loadFail" @call-back="invalidPwdCb" /> {