新增登录页图形验证码功能,支持通过Redis全局配置控制验证码的启用状态,优化登录流程以提升用户体验。新增相关API接口和前端配置项,确保验证码逻辑与后端同步。
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { defineComponent, computed, unref } from 'vue';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { BasicDrawer } from '/@/components/Drawer/index';
|
||||
import { Divider } from 'ant-design-vue';
|
||||
import { TypePicker, ThemeColorPicker, SettingFooter, SwitchItem, SelectItem, InputNumberItem } from './components';
|
||||
@@ -47,8 +48,13 @@ export default defineComponent({
|
||||
getShowDarkModeToggle,
|
||||
getThemeColor,
|
||||
getAiIconShow,
|
||||
getLoginCaptchaEnabled,
|
||||
} = useRootSetting();
|
||||
|
||||
const { hasPermission } = usePermission();
|
||||
/** 项目配置中「验证码登录」开关仅对有权限的用户展示 */
|
||||
const showLoginCaptchaSetting = computed(() => hasPermission('system:project:setting:loginCaptcha'));
|
||||
|
||||
const { getOpenPageLoading, getBasicTransition, getEnableTransition, getOpenNProgress } = useTransitionSetting();
|
||||
|
||||
const {
|
||||
@@ -318,6 +324,13 @@ export default defineComponent({
|
||||
<SwitchItem title={t('layout.setting.colorWeak')} event={HandlerEnum.COLOR_WEAK} def={unref(getColorWeak)} />
|
||||
|
||||
<SwitchItem title={t('layout.setting.aiIconSHow')} event={HandlerEnum.AI_ICON_SHOW} def={unref(getAiIconShow)} />
|
||||
{unref(showLoginCaptchaSetting) && (
|
||||
<SwitchItem
|
||||
title={t('layout.setting.loginCaptcha')}
|
||||
event={HandlerEnum.LOGIN_CAPTCHA_ENABLED}
|
||||
def={unref(getLoginCaptchaEnabled)}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user