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