Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ui/src/views/login/ForgotPasswordView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, reactive, ref } from 'vue'
import { computed, onMounted, reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
import JSEncrypt from 'jsencrypt'
import type { FormInstance, FormRules } from 'element-plus'
Expand Down Expand Up @@ -29,6 +29,7 @@ const isSubmitting = ref(false)
const isSendingCode = ref(false)
const countdown = ref(0)
let countdownTimer: number | undefined
const isSendCodeDisabled = computed(() => !forgotPasswordForm.email.trim() || isSendingCode.value || countdown.value > 0)

const validateConfirmPassword = (_rule: unknown, value: string, callback: (error?: Error) => void) => {
if (!value) {
Expand Down Expand Up @@ -136,8 +137,8 @@ onMounted(() => {
<el-form-item prop="verificationCode">
<div class="flex w-full gap-3">
<el-input v-model="forgotPasswordForm.verificationCode" placeholder="请输入验证码" />
<el-button plain class="w-35 shrink-0" :disabled="countdown > 0" :loading="isSendingCode" @click="handleSendCode">
{{ countdown > 0 ? `${countdown}s` : '获取验证码' }}
<el-button plain class="w-35 shrink-0" :disabled="isSendCodeDisabled" :loading="isSendingCode" @click="handleSendCode">
{{ countdown > 0 ? `重新发送 (${countdown}s)` : '获取验证码' }}
</el-button>
</div>
</el-form-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const importUsersForm = reactive<ImportUsersForm>({ files: [], syncType: '', use
const importUsersFormRules: FormRules<ImportUsersForm> = {
files: [{ required: true, type: 'array', min: 1, message: '请上传文件', trigger: 'change' }],
syncType: [{ required: true, message: '请选择用户来源', trigger: 'change' }],
userGroupId: [{ required: true, message: '请选择用户组', trigger: 'change' }],
}
const isLocalFileSource = computed(() => importUsersForm.syncType === LOCAL_FILE_SOURCE)
const canImport = computed(() => Boolean(importUsersForm.syncType) && (!isLocalFileSource.value || importUsersForm.files.length > 0))
Expand Down Expand Up @@ -186,7 +187,7 @@ defineExpose({ open })
/>
</el-form-item>

<el-form-item label="用户组">
<el-form-item label="用户组" prop="userGroupId">
<el-select
v-model="importUsersForm.userGroupId"
class="w-full"
Expand Down
Loading