fix: 修复 ip 地址登录系统报错,ts 方法兼容旧版本浏览器

This commit is contained in:
2026-06-24 16:58:49 +08:00
parent 7cf6c31da3
commit 1a91e16ac9
8 changed files with 393 additions and 129 deletions

View File

@@ -258,7 +258,7 @@ function selectedVariant(round: AgentTryoutRawRound) {
return (
round.variants.find(
(variant) => variant.variantIndex === round.selectedVariantIndex,
) || round.variants.at(-1)
) || round.variants[round.variants.length - 1]
);
}

View File

@@ -1,18 +1,17 @@
<script setup lang="ts">
import type { FormInstance } from 'element-plus';
import type {FormInstance} from 'element-plus';
import {ElForm, ElFormItem, ElInput, ElMessage} from 'element-plus';
import { onMounted, ref } from 'vue';
import {onMounted, ref} from 'vue';
import { EasyFlowFormModal } from '@easyflow/common-ui';
import { getResourceType } from '@easyflow/utils';
import {EasyFlowFormModal} from '@easyflow/common-ui';
import {getResourceType} from '@easyflow/utils';
import { ElForm, ElFormItem, ElInput, ElMessage } from 'element-plus';
import { api } from '#/api/request';
import {api} from '#/api/request';
import DictSelect from '#/components/dict/DictSelect.vue';
import Upload from '#/components/upload/Upload.vue';
import { $t } from '#/locales';
import { syncProgrammaticFieldValidation } from '#/utils/form-validation';
import {$t} from '#/locales';
import {syncProgrammaticFieldValidation} from '#/utils/form-validation';
const emit = defineEmits(['reload']);
// vue
@@ -99,7 +98,7 @@ function closeDialog() {
function beforeUpload(f: any) {
const fileName = f?.name || '';
const fileNameParts = fileName.split('.');
const fExt = fileNameParts.length > 1 ? fileNameParts.at(-1) || '' : '';
const fExt = fileNameParts.length > 1 ? fileNameParts[fileNameParts.length - 1] || '' : '';
const fName =
fileNameParts.length > 1 ? fileNameParts.slice(0, -1).join('.') : fileName;
entity.value.resourceType = getResourceType(fExt);