feat:增加前端验证码开关

This commit is contained in:
lbw 2023-04-17 21:22:44 +08:00
parent 0b2da956de
commit 52ef953c51
2 changed files with 8 additions and 1 deletions

2
.env
View File

@ -25,6 +25,8 @@ VITE_OAUTH2_MOBILE_CLIENT='app:app'
# OAUTH2 社交登录客户端信息
VITE_OAUTH2_SOCIAL_CLIENT='social:social'
# 是否开启前端滑块验证码
VITE_VERIFY_ENABLE = true
# 是否开启websocket 消息接受,
VITE_WEBSOCKET_ENABLE = false

View File

@ -73,12 +73,17 @@ const loginRules = reactive({
});
const verifyref = ref<InstanceType<typeof Verify>>(null); // verify
//
const verifyEnable = ref(import.meta.env.VITE_VERIFY_ENABLE === 'true');
//
const handleVerify = async () => {
const valid = await loginFormRef.value.validate().catch(() => {}); //
if (valid) {
if (valid && verifyEnable.value) {
verifyref.value.show(); //
} else if (valid) {
onSignIn(); //
}
};