fix:密码登录界面报错修复
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue';
|
||||
import { loginModuleRecord } from '@/constants/app';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
import { useAntdForm, useFormRules } from '@/hooks/common/form';
|
||||
import { useAuthStore } from '@/store/modules/auth';
|
||||
import {useI18n} from "vue-i18n";
|
||||
|
||||
// Add interface for check code response
|
||||
interface CheckCodeResponse {
|
||||
uuid: string;
|
||||
img: string;
|
||||
text?: string; // Make text optional since it might not always be present
|
||||
}
|
||||
|
||||
defineOptions({
|
||||
name: 'PwdLogin'
|
||||
@@ -45,10 +52,11 @@ async function handleSubmit() {
|
||||
async function getCheckCode() {
|
||||
const { data, error } = await doGetCheckCode();
|
||||
if (!error) {
|
||||
codeImg.value = `data:image/png;base64,${data.img}`;
|
||||
model.uuid = data.uuid;
|
||||
if (data?.text) {
|
||||
model.code = data.text;
|
||||
const checkCodeData = data as CheckCodeResponse;
|
||||
codeImg.value = `data:image/png;base64,${checkCodeData.img}`;
|
||||
model.uuid = checkCodeData.uuid;
|
||||
if (checkCodeData?.text) {
|
||||
model.code = checkCodeData.text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user