mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix(deps): 去除图片验证码依赖
This commit is contained in:
@ -7,17 +7,6 @@
|
||||
<n-form-item path="pwd">
|
||||
<n-input v-model:value="model.pwd" placeholder="密码" />
|
||||
</n-form-item>
|
||||
<n-form-item path="isCaptcha">
|
||||
<div class="w-full">
|
||||
<mi-captcha
|
||||
:theme-color="theme.themeColor"
|
||||
:bg-color="themeVars.inputColor"
|
||||
:text-color="themeVars.textColorBase"
|
||||
:logo="logo"
|
||||
@success="handleCaptcha"
|
||||
/>
|
||||
</div>
|
||||
</n-form-item>
|
||||
<n-space :vertical="true" size="large">
|
||||
<div class="flex-y-center justify-between">
|
||||
<n-checkbox v-model:checked="rememberMe">记住我</n-checkbox>
|
||||
@ -43,27 +32,22 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { NForm, NFormItem, NInput, NSpace, NCheckbox, NButton, useNotification, useThemeVars } from 'naive-ui';
|
||||
import { NForm, NFormItem, NInput, NSpace, NCheckbox, NButton, useNotification } from 'naive-ui';
|
||||
import type { FormInst, FormRules } from 'naive-ui';
|
||||
import { EnumLoginModule } from '@/enum';
|
||||
import { useThemeStore } from '@/store';
|
||||
import { useRouterChange, useRouteQuery, useLoading } from '@/hooks';
|
||||
import { setToken } from '@/utils';
|
||||
import { OtherLogin } from './components';
|
||||
import logo from '@/assets/img/common/logo.png';
|
||||
|
||||
const theme = useThemeStore();
|
||||
const { toHome, toCurrentLogin, toLoginRedirectUrl } = useRouterChange();
|
||||
const { loginRedirectUrl } = useRouteQuery();
|
||||
const { loading, startLoading, endLoading } = useLoading();
|
||||
const notification = useNotification();
|
||||
const themeVars = useThemeVars();
|
||||
|
||||
const formRef = ref<(HTMLElement & FormInst) | null>(null);
|
||||
const model = reactive({
|
||||
phone: '15100000000',
|
||||
pwd: '123456',
|
||||
isCaptcha: false
|
||||
pwd: '123456'
|
||||
});
|
||||
const rules: FormRules = {
|
||||
phone: {
|
||||
@ -75,21 +59,10 @@ const rules: FormRules = {
|
||||
required: true,
|
||||
trigger: ['blur', 'input'],
|
||||
message: '请输入密码'
|
||||
},
|
||||
isCaptcha: {
|
||||
required: true,
|
||||
type: 'boolean',
|
||||
trigger: 'change',
|
||||
message: '请点击按钮进行验证码校验',
|
||||
validator: (_, value) => value === true
|
||||
}
|
||||
};
|
||||
const rememberMe = ref(false);
|
||||
|
||||
function handleCaptcha() {
|
||||
model.isCaptcha = true;
|
||||
}
|
||||
|
||||
function handleSubmit(e: MouseEvent) {
|
||||
if (!formRef.value) return;
|
||||
e.preventDefault();
|
||||
|
Reference in New Issue
Block a user