diff --git a/apps/oss/serializers/file.py b/apps/oss/serializers/file.py index a167f6e87..b9cbe218b 100644 --- a/apps/oss/serializers/file.py +++ b/apps/oss/serializers/file.py @@ -44,11 +44,12 @@ mime_types = { "dll": "application/octet-stream", "deb": "application/octet-stream", "dmg": "application/octet-stream", "iso": "application/octet-stream", "img": "application/octet-stream", "msi": "application/octet-stream", "msp": "application/octet-stream", "msm": "application/octet-stream", "mid": "audio/midi", - "midi": "audio/midi", "kar": "audio/midi", "mp3": "audio/mpeg", "ogg": "audio/ogg", "m4a": "audio/x-m4a", + "midi": "audio/midi", "kar": "audio/midi", "mp3": "audio/mp3", "ogg": "audio/ogg", "m4a": "audio/x-m4a", "ra": "audio/x-realaudio", "3gpp": "video/3gpp", "3gp": "video/3gpp", "ts": "video/mp2t", "mp4": "video/mp4", "mpeg": "video/mpeg", "mpg": "video/mpeg", "mov": "video/quicktime", "webm": "video/webm", "flv": "video/x-flv", "m4v": "video/x-m4v", "mng": "video/x-mng", - "asx": "video/x-ms-asf", "asf": "video/x-ms-asf", "wmv": "video/x-ms-wmv", "avi": "video/x-msvideo" + "asx": "video/x-ms-asf", "asf": "video/x-ms-asf", "wmv": "video/x-ms-wmv", "avi": "video/x-msvideo", + "wav": "audio/wav", "flac": "audio/flac", "aac": "audio/aac", "opus": "audio/opus", } @@ -77,21 +78,16 @@ class FileSerializer(serializers.Serializer): file = QuerySet(File).filter(id=file_id).first() if file is None: raise NotFound404(404, _('File not found')) - # 如果是音频文件,直接返回文件流 - file_type = file.file_name.split(".")[-1] - if file_type in ['mp3', 'wav', 'ogg', 'aac']: - return HttpResponse( - file.get_bytes(), - status=200, - headers={ - 'Content-Type': f'audio/{file_type}', - 'Content-Disposition': 'attachment; filename="{}"'.format(file.file_name) - } - ) + file_type = file.file_name.split(".")[-1].lower() + content_type = mime_types.get(file_type, 'application/octet-stream') + headers = { + 'Content-Type': content_type, + 'Content-Disposition': f'attachment; filename="{file.file_name}"' + } return HttpResponse( file.get_bytes(), status=200, - headers={'Content-Type': mime_types.get(file_type, 'text/plain')} + headers=headers ) def delete(self): diff --git a/ui/src/api/application/application-overview.ts b/ui/src/api/application/application-overview.ts index 0513a0d34..6c3a0e373 100644 --- a/ui/src/api/application/application-overview.ts +++ b/ui/src/api/application/application-overview.ts @@ -32,8 +32,8 @@ const postAPIKey: (application_id: string, loading?: Ref) => Promise ) => Promise> = (application_id, api_key_id, loading) => { return del(`${prefix}/${application_id}/api_key/${api_key_id}`, undefined, undefined, loading) @@ -48,7 +48,7 @@ const delAPIKey: ( */ const putAPIKey: ( application_id: string, - api_key_id: String, + api_key_id: string, data: any, loading?: Ref ) => Promise> = (application_id, api_key_id, data, loading) => { diff --git a/ui/src/api/application/application.ts b/ui/src/api/application/application.ts index 274b871ab..3bbc8e2fe 100644 --- a/ui/src/api/application/application.ts +++ b/ui/src/api/application/application.ts @@ -49,7 +49,7 @@ const postApplication: ( * @param 参数 */ const putApplication: ( - application_id: String, + application_id: string, data: ApplicationFormType, loading?: Ref, ) => Promise> = (application_id, data, loading) => { @@ -61,7 +61,7 @@ const putApplication: ( * @param 参数 application_id */ const delApplication: ( - application_id: String, + application_id: string, loading?: Ref, ) => Promise> = (application_id, loading) => { return del(`${prefix}/${application_id}`, undefined, {}, loading) @@ -177,7 +177,7 @@ const postWorkflowChatOpen: (data: ApplicationFormType) => Promise> ] } */ -const getChatOpen: (application_id: String) => Promise> = (application_id) => { +const getChatOpen: (application_id: string) => Promise> = (application_id) => { return get(`${prefix}/${application_id}/chat/open`) } /** @@ -305,7 +305,7 @@ const getApplicationTTIModel: ( * @param 参数 */ const putPublishApplication: ( - application_id: String, + application_id: string, data: ApplicationFormType, loading?: Ref, ) => Promise> = (application_id, data, loading) => { @@ -317,7 +317,7 @@ const putPublishApplication: ( * @param loading * @returns */ -const listFunctionLib: (application_id: String, loading?: Ref) => Promise> = ( +const listFunctionLib: (application_id: string, loading?: Ref) => Promise> = ( application_id, loading, ) => { @@ -343,8 +343,8 @@ export const getApplicationList: ( * @returns */ const getFunctionLib: ( - application_id: String, - function_lib_id: String, + application_id: string, + function_lib_id: string, loading?: Ref, ) => Promise> = (application_id, function_lib_id, loading) => { return get(`${prefix}/${application_id}/function_lib/${function_lib_id}`, undefined, loading) @@ -358,8 +358,8 @@ const getMcpTools: (data: any, loading?: Ref) => Promise> = } const getApplicationById: ( - application_id: String, - app_id: String, + application_id: string, + app_id: string, loading?: Ref, ) => Promise> = (application_id, app_id, loading) => { return get(`${prefix}/${application_id}/application/${app_id}`, undefined, loading) @@ -372,8 +372,8 @@ const getApplicationById: ( * @returns */ const getModelParamsForm: ( - application_id: String, - model_id: String, + application_id: string, + model_id: string, loading?: Ref, ) => Promise>> = (application_id, model_id, loading) => { return get(`${prefix}/${application_id}/model_params_form/${model_id}`, undefined, loading) @@ -383,8 +383,8 @@ const getModelParamsForm: ( * 上传文档图片附件 */ const uploadFile: ( - application_id: String, - chat_id: String, + application_id: string, + chat_id: string, data: any, loading?: Ref, ) => Promise> = (application_id, chat_id, data, loading) => { @@ -395,7 +395,7 @@ const uploadFile: ( * 语音转文本 */ const postSpeechToText: ( - application_id: String, + application_id: string, data: any, loading?: Ref, ) => Promise> = (application_id, data, loading) => { @@ -406,7 +406,7 @@ const postSpeechToText: ( * 文本转语音 */ const postTextToSpeech: ( - application_id: String, + application_id: string, data: any, loading?: Ref, ) => Promise> = (application_id, data, loading) => { @@ -417,7 +417,7 @@ const postTextToSpeech: ( * 播放测试文本 */ const playDemoText: ( - application_id: String, + application_id: string, data: any, loading?: Ref, ) => Promise> = (application_id, data, loading) => { diff --git a/ui/src/api/tool/tool.ts b/ui/src/api/tool/tool.ts index 0248bbf03..e9436abe5 100644 --- a/ui/src/api/tool/tool.ts +++ b/ui/src/api/tool/tool.ts @@ -70,7 +70,7 @@ const putTool: ( * @returns 函数详情 */ const getToolById: ( - tool_id: String, + tool_id: string, loading?: Ref, ) => Promise> = (tool_id, loading) => { return get(`${prefix}/tool/${tool_id}`, undefined, loading) diff --git a/ui/src/api/type/application.ts b/ui/src/api/type/application.ts index fb45ae548..d391d759f 100644 --- a/ui/src/api/type/application.ts +++ b/ui/src/api/type/application.ts @@ -45,7 +45,7 @@ interface chatType { id: string problem_text: string answer_text: string - buffer: Array + buffer: Array answer_text_list: Array< Array<{ content: string diff --git a/ui/src/api/type/knowledge.ts b/ui/src/api/type/knowledge.ts index f5002d97b..17cef30f3 100644 --- a/ui/src/api/type/knowledge.ts +++ b/ui/src/api/type/knowledge.ts @@ -1,8 +1,8 @@ interface knowledgeData { - name: String - folder_id?: String - desc: String - embedding?: String + name: string + folder_id?: string + desc: string + embedding?: string documents?: Array } diff --git a/ui/src/api/type/tool.ts b/ui/src/api/type/tool.ts index 85b77a827..ecdf51566 100644 --- a/ui/src/api/type/tool.ts +++ b/ui/src/api/type/tool.ts @@ -1,13 +1,13 @@ interface toolData { - id?: String - name?: String - icon?: String - desc?: String - code?: String + id?: string + name?: string + icon?: string + desc?: string + code?: string input_field_list?: Array init_field_list?: Array - is_active?: Boolean - folder_id?: String + is_active?: boolean + folder_id?: string } export type { toolData } diff --git a/ui/src/components/codemirror-editor/index.vue b/ui/src/components/codemirror-editor/index.vue index 37f1883d4..eb2dd5b24 100644 --- a/ui/src/components/codemirror-editor/index.vue +++ b/ui/src/components/codemirror-editor/index.vue @@ -49,7 +49,7 @@ import ToolApi from '@/api/tool/tool' defineOptions({name: 'CodemirrorEditor'}) const props = defineProps<{ - title: String + title: string modelValue: any }>() const emit = defineEmits(['update:modelValue', 'submitDialog']) @@ -73,7 +73,7 @@ function getRangeFromLineAndColumn(state: any, line: number, column: number, end } const regexpLinter = linter(async (view) => { - let diagnostics: Diagnostic[] = [] + const diagnostics: Diagnostic[] = [] await ToolApi.postPylint(view.state.doc.toString()).then((ok) => { ok.data.forEach((element: any) => { const range = getRangeFromLineAndColumn( diff --git a/ui/src/components/common-list/index.vue b/ui/src/components/common-list/index.vue index 03ad5fe38..3e0c59aca 100644 --- a/ui/src/components/common-list/index.vue +++ b/ui/src/components/common-list/index.vue @@ -36,7 +36,7 @@ const props = withDefaults( }, ) -const current = ref(0) +const current = ref(0) watch( () => props.defaultActive, diff --git a/ui/src/components/dynamics-form/FormItem.vue b/ui/src/components/dynamics-form/FormItem.vue index a547ebaa0..fb6212734 100644 --- a/ui/src/components/dynamics-form/FormItem.vue +++ b/ui/src/components/dynamics-form/FormItem.vue @@ -114,7 +114,7 @@ const errMsg = computed(() => { */ const to_rule = (rule: any) => { if (rule.validator) { - let validator = (rule: any, value: string, callback: any) => {} + const validator = (rule: any, value: string, callback: any) => {} eval(rule.validator) return { ...rule, validator } } diff --git a/ui/src/components/dynamics-form/index.vue b/ui/src/components/dynamics-form/index.vue index cb4c6e58e..e0c5a0d2b 100644 --- a/ui/src/components/dynamics-form/index.vue +++ b/ui/src/components/dynamics-form/index.vue @@ -74,12 +74,12 @@ const formFieldRef = ref>>([]) */ const show = (field: FormField) => { if (field.relation_show_field_dict) { - let keys = Object.keys(field.relation_show_field_dict) + const keys = Object.keys(field.relation_show_field_dict) for (const index in keys) { const key = keys[index] - let v = _.get(formValue.value, key) + const v = _.get(formValue.value, key) if (v && v !== undefined && v !== null) { - let values = field.relation_show_field_dict[key] + const values = field.relation_show_field_dict[key] if (values && values.length > 0) { return values.includes(v) } else { diff --git a/ui/src/layout/layout-header/avatar/APIKeyDialog.vue b/ui/src/layout/layout-header/avatar/APIKeyDialog.vue index a03337792..62f393fbb 100644 --- a/ui/src/layout/layout-header/avatar/APIKeyDialog.vue +++ b/ui/src/layout/layout-header/avatar/APIKeyDialog.vue @@ -125,7 +125,7 @@ function deleteApiKey(row: any) { .catch(() => {}) } -function changeState(bool: Boolean, row: any) { +function changeState(bool: boolean, row: any) { const obj = { is_active: bool } diff --git a/ui/src/layout/layout-header/avatar/AboutDialog.vue b/ui/src/layout/layout-header/avatar/AboutDialog.vue index 025d2bcc2..3e59fde80 100644 --- a/ui/src/layout/layout-header/avatar/AboutDialog.vue +++ b/ui/src/layout/layout-header/avatar/AboutDialog.vue @@ -96,7 +96,7 @@ const open = () => { } const onChange = (file: any) => { - let fd = new FormData() + const fd = new FormData() fd.append('license_file', file.raw) licenseApi.putLicense(fd, loading).then((res: any) => { getLicenseInfo() diff --git a/ui/src/locales/index.ts b/ui/src/locales/index.ts index 86f0a8c4d..7adab4032 100644 --- a/ui/src/locales/index.ts +++ b/ui/src/locales/index.ts @@ -5,13 +5,13 @@ import {createI18n} from 'vue-i18n' // 导入语言文件 const langModules = import.meta.glob('./lang/*/index.ts', {eager: true}) as Record< string, - () => Promise<{ default: Object }> + () => Promise<{ default: object }> > // 定义 Recordable 类型 type Recordable = Record -const langModuleMap = new Map() +const langModuleMap = new Map() export const langCode: Array = [] diff --git a/ui/src/stores/modules/login.ts b/ui/src/stores/modules/login.ts index 636af77cc..bc447cc41 100644 --- a/ui/src/stores/modules/login.ts +++ b/ui/src/stores/modules/login.ts @@ -10,7 +10,7 @@ const useLoginStore = defineStore('login', { userAccessToken: '', }), actions: { - getToken(): String | null { + getToken(): string | null { if (this.token) { return this.token } diff --git a/ui/src/stores/modules/user.ts b/ui/src/stores/modules/user.ts index 7ccb0dbcc..0cc551036 100644 --- a/ui/src/stores/modules/user.ts +++ b/ui/src/stores/modules/user.ts @@ -65,7 +65,7 @@ const useLoginStore = defineStore('user', { this.XPACK_LICENSE_IS_VALID = true if (this.isEnterprise()) { - // await this.theme() + // await this.theme() } else { this.themeInfo = { ...defaultPlatformSetting diff --git a/ui/src/utils/common.ts b/ui/src/utils/common.ts index 64020a88e..f825c3c59 100644 --- a/ui/src/utils/common.ts +++ b/ui/src/utils/common.ts @@ -63,6 +63,6 @@ export function filesize(size: number) { // 头像 export const defaultIcon = '/ui/favicon.ico' -export function isAppIcon(url: String | undefined) { +export function isAppIcon(url: string | undefined) { return url === defaultIcon ? '' : url } diff --git a/ui/src/utils/message.ts b/ui/src/utils/message.ts index fb20c5c47..2c70ba403 100644 --- a/ui/src/utils/message.ts +++ b/ui/src/utils/message.ts @@ -38,7 +38,7 @@ export const MsgError = (message: string) => { } export const MsgAlert = (title: string, description: string, options?: any) => { - const defaultOptions: Object = { + const defaultOptions: object = { confirmButtonText: t('common.confirm'), ...options } @@ -51,7 +51,7 @@ export const MsgAlert = (title: string, description: string, options?: any) => { */ export const MsgConfirm = (title: string, description: string, options?: any) => { - const defaultOptions: Object = { + const defaultOptions: object = { showCancelButton: true, confirmButtonText: t('common.confirm'), cancelButtonText: t('common.cancel'), diff --git a/ui/src/utils/status.ts b/ui/src/utils/status.ts index 16f98599e..f8f4ca7ed 100644 --- a/ui/src/utils/status.ts +++ b/ui/src/utils/status.ts @@ -50,7 +50,7 @@ class Status { } status = status.split('').reverse().join('') this.task_status = {} - for (let key in TaskType) { + for (const key in TaskType) { const value = TaskType[key as keyof TaskTypeInterface] const index = value - 1 this.task_status[value] = status[index] ? status[index] : 'n' @@ -58,7 +58,7 @@ class Status { } toString() { const r = [] - for (let key in TaskType) { + for (const key in TaskType) { const value = TaskType[key as keyof TaskTypeInterface] r.push(this.task_status[value]) } diff --git a/ui/src/views/application-overview/component/EditAvatarDialog.vue b/ui/src/views/application-overview/component/EditAvatarDialog.vue index 35565f31b..56a33140a 100644 --- a/ui/src/views/application-overview/component/EditAvatarDialog.vue +++ b/ui/src/views/application-overview/component/EditAvatarDialog.vue @@ -120,7 +120,7 @@ function submit() { dialogVisible.value = false }) } else if (radioType.value === 'custom' && iconFile.value) { - let fd = new FormData() + const fd = new FormData() fd.append('file', iconFile.value.raw) overviewApi.putAppIcon(id as string, fd, loading).then((res: any) => { emit('refresh') diff --git a/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue b/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue index 4de712ace..51aae395b 100644 --- a/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue +++ b/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue @@ -573,7 +573,7 @@ const submit = async (formEl: FormInstance | undefined) => { if (!formEl) return await formEl.validate((valid, fields) => { if (valid) { - let fd = new FormData() + const fd = new FormData() Object.keys(xpackForm.value).map((item) => { if (['custom_theme', 'float_location'].includes(item)) { fd.append(item, JSON.stringify(xpackForm.value[item])) diff --git a/ui/src/views/application-overview/index.vue b/ui/src/views/application-overview/index.vue index ed704e5be..609feb6c3 100644 --- a/ui/src/views/application-overview/index.vue +++ b/ui/src/views/application-overview/index.vue @@ -334,7 +334,7 @@ function refreshAccessToken() { }) .catch(() => {}) } -function changeState(bool: Boolean) { +function changeState(bool: boolean) { const obj = { is_active: !bool } diff --git a/ui/src/views/application-workflow/index.vue b/ui/src/views/application-workflow/index.vue index b2a15519c..35e745b4e 100644 --- a/ui/src/views/application-workflow/index.vue +++ b/ui/src/views/application-workflow/index.vue @@ -278,7 +278,7 @@ async function publicHandle() { MsgError(e.toString()) return } - applicationApi.putPublishApplication(id as String, obj, loading).then(() => { + applicationApi.putPublishApplication(id as string, obj, loading).then(() => { application.asyncGetApplicationDetail(id, loading).then((res: any) => { detail.value.name = res.data.name diff --git a/ui/src/views/authentication/component/EditModal.vue b/ui/src/views/authentication/component/EditModal.vue index c23e69867..28246a05f 100644 --- a/ui/src/views/authentication/component/EditModal.vue +++ b/ui/src/views/authentication/component/EditModal.vue @@ -154,7 +154,7 @@ const open = async (platform: Platform) => { Object.assign(currentPlatform, platform) // 设置默认的 callback_url - let defaultCallbackUrl = window.location.origin + const defaultCallbackUrl = window.location.origin switch (platform.key) { case 'wecom': if (currentPlatform.config.app_key) { diff --git a/ui/src/views/knowledge/UploadDocumentKnowledge.vue b/ui/src/views/knowledge/UploadDocumentKnowledge.vue index 513701b51..32cb2c3fc 100644 --- a/ui/src/views/knowledge/UploadDocumentKnowledge.vue +++ b/ui/src/views/knowledge/UploadDocumentKnowledge.vue @@ -82,7 +82,7 @@ async function next() { disabled.value = true if (await UploadComponentRef.value.validate()) { if (documentsType.value === 'QA') { - let fd = new FormData() + const fd = new FormData() documentsFiles.value.forEach((item: any) => { if (item?.raw) { fd.append('file', item?.raw) @@ -97,7 +97,7 @@ async function next() { }) } } else if (documentsType.value === 'table') { - let fd = new FormData() + const fd = new FormData() documentsFiles.value.forEach((item: any) => { if (item?.raw) { fd.append('file', item?.raw) diff --git a/ui/src/views/knowledge/component/SetRules.vue b/ui/src/views/knowledge/component/SetRules.vue index 07e9acdec..f5c74923b 100644 --- a/ui/src/views/knowledge/component/SetRules.vue +++ b/ui/src/views/knowledge/component/SetRules.vue @@ -168,7 +168,7 @@ function changeHandle(val: boolean) { } function splitDocument() { loading.value = true - let fd = new FormData() + const fd = new FormData() documentsFiles.value.forEach((item) => { if (item?.raw) { fd.append('file', item?.raw) diff --git a/ui/src/views/model/component/CreateModelDialog.vue b/ui/src/views/model/component/CreateModelDialog.vue index 985e3d32a..cc9ec1d24 100644 --- a/ui/src/views/model/component/CreateModelDialog.vue +++ b/ui/src/views/model/component/CreateModelDialog.vue @@ -440,7 +440,7 @@ function deleteParam(index: any) { function refresh(data: any, index: any) { for (let i = 0; i < base_form_data.value.model_params_form.length; i++) { - let field = base_form_data.value.model_params_form[i].field + const field = base_form_data.value.model_params_form[i].field let label = base_form_data.value.model_params_form[i].label if (label && label.input_type === 'TooltipLabel') { label = label.label diff --git a/ui/src/views/model/component/ParamSettingDialog.vue b/ui/src/views/model/component/ParamSettingDialog.vue index 01c785a09..2da387f7c 100644 --- a/ui/src/views/model/component/ParamSettingDialog.vue +++ b/ui/src/views/model/component/ParamSettingDialog.vue @@ -124,7 +124,7 @@ function deleteParam(index: any) { function refresh(data: any, index: any) { for (let i = 0; i < modelParamsForm.value.length; i++) { - let field = modelParamsForm.value[i].field + const field = modelParamsForm.value[i].field let label = modelParamsForm.value[i].label if (label && label.input_type === 'TooltipLabel') { label = label.label diff --git a/ui/src/views/problem/component/RelateProblemDialog.vue b/ui/src/views/problem/component/RelateProblemDialog.vue index 963ec1713..2437884c3 100644 --- a/ui/src/views/problem/component/RelateProblemDialog.vue +++ b/ui/src/views/problem/component/RelateProblemDialog.vue @@ -131,13 +131,13 @@ const loading = ref(false) const documentList = ref([]) const cloneDocumentList = ref([]) const paragraphList = ref([]) -const currentProblemId = ref('') +const currentProblemId = ref('') const currentMulProblemId = ref([]) // 回显 const associationParagraph = ref([]) -const currentDocument = ref('') +const currentDocument = ref('') const search = ref('') const searchType = ref('title') const filterDoc = ref('') @@ -222,7 +222,7 @@ function getDocument() { }) } -function getParagraphList(documentId: String) { +function getParagraphList(documentId: string) { paragraphApi .getParagraph( id, @@ -238,16 +238,16 @@ function getParagraphList(documentId: String) { } // 已关联分段 -function getRecord(problemId: String) { +function getRecord(problemId: string) { problemApi.getDetailProblems(id as string, problemId as string, loading).then((res) => { associationParagraph.value = res.data }) } -function associationCount(documentId: String) { +function associationCount(documentId: string) { return associationParagraph.value.filter((item) => item.document_id === documentId).length } -function isAssociation(paragraphId: String) { +function isAssociation(paragraphId: string) { return associationParagraph.value.some((option) => option.id === paragraphId) } diff --git a/ui/src/views/problem/index.vue b/ui/src/views/problem/index.vue index 249dcea41..096a7e14a 100644 --- a/ui/src/views/problem/index.vue +++ b/ui/src/views/problem/index.vue @@ -305,12 +305,12 @@ const nextChatRecord = () => { } } const pre_disable = computed(() => { - let index = problemIndexMap.value[currentClickId.value] - 1 + const index = problemIndexMap.value[currentClickId.value] - 1 return index < 0 && paginationConfig.current_page <= 1 }) const next_disable = computed(() => { - let index = problemIndexMap.value[currentClickId.value] + 1 + const index = problemIndexMap.value[currentClickId.value] + 1 return ( index >= problemData.value.length && index + (paginationConfig.current_page - 1) * paginationConfig.page_size >= diff --git a/ui/src/views/resource-authorization/component/CreateMemberDialog.vue b/ui/src/views/resource-authorization/component/CreateMemberDialog.vue index df85591db..f291b1c2c 100644 --- a/ui/src/views/resource-authorization/component/CreateMemberDialog.vue +++ b/ui/src/views/resource-authorization/component/CreateMemberDialog.vue @@ -82,7 +82,7 @@ const submitMember = async (formEl: FormInstance | undefined) => { if (!formEl) return await formEl.validate((valid, fields) => { if (valid) { - let idsArray = memberForm.value.users.map((obj: any) => obj.id) + const idsArray = memberForm.value.users.map((obj: any) => obj.id) AuthorizationApi.postCreatTeamMember(idsArray, loading).then((res) => { MsgSuccess(t('common.submitSuccess')) emit('refresh', idsArray) diff --git a/ui/src/views/resource-authorization/index.vue b/ui/src/views/resource-authorization/index.vue index 08a66ba94..8064e9627 100644 --- a/ui/src/views/resource-authorization/index.vue +++ b/ui/src/views/resource-authorization/index.vue @@ -108,7 +108,7 @@ watch(filterText, (val: any) => { } }) -function isManage(type: String) { +function isManage(type: string) { return type === 'manage' } diff --git a/ui/src/views/tool/component/EditAvatarDialog.vue b/ui/src/views/tool/component/EditAvatarDialog.vue index 69fcf0fae..298f08aa8 100644 --- a/ui/src/views/tool/component/EditAvatarDialog.vue +++ b/ui/src/views/tool/component/EditAvatarDialog.vue @@ -109,7 +109,7 @@ function submit() { emit('refresh', '/ui/favicon.ico') dialogVisible.value = false } else if (radioType.value === 'custom' && iconFile.value) { - let fd = new FormData() + const fd = new FormData() fd.append('file', iconFile.value.raw) toolApi.putToolIcon(detail.value.id, fd, loading).then((res: any) => { emit('refresh', res.data) diff --git a/ui/src/workflow/common/NodeCascader.vue b/ui/src/workflow/common/NodeCascader.vue index 66a039cfe..007f8b1bf 100644 --- a/ui/src/workflow/common/NodeCascader.vue +++ b/ui/src/workflow/common/NodeCascader.vue @@ -25,7 +25,7 @@ import { t } from '@/locales' const props = defineProps<{ nodeModel: any modelValue: Array - global?: Boolean + global?: boolean }>() const emit = defineEmits(['update:modelValue']) const data = computed({ diff --git a/ui/src/workflow/nodes/base-node/component/ApiInputFieldTable.vue b/ui/src/workflow/nodes/base-node/component/ApiInputFieldTable.vue index c81ebc94f..e6d62c8dd 100644 --- a/ui/src/workflow/nodes/base-node/component/ApiInputFieldTable.vue +++ b/ui/src/workflow/nodes/base-node/component/ApiInputFieldTable.vue @@ -94,7 +94,7 @@ function refreshFieldList(data: any) { } } // 查看另一个list又没有重复的 - let arr = props.nodeModel.properties.user_input_field_list + const arr = props.nodeModel.properties.user_input_field_list for (let i = 0; i < arr.length; i++) { if (arr[i].field === data.variable) { MsgError(t('views.applicationWorkflow.tip.paramErrorMessage') + data.variable) diff --git a/ui/src/workflow/nodes/base-node/component/UserInputFieldTable.vue b/ui/src/workflow/nodes/base-node/component/UserInputFieldTable.vue index 88615954c..e6d2e1c7e 100644 --- a/ui/src/workflow/nodes/base-node/component/UserInputFieldTable.vue +++ b/ui/src/workflow/nodes/base-node/component/UserInputFieldTable.vue @@ -149,7 +149,7 @@ function refreshFieldList(data: any, index: any) { } } // 查看另一个list又没有重复的 - let arr = props.nodeModel.properties.api_input_field_list + const arr = props.nodeModel.properties.api_input_field_list for (let i = 0; i < arr.length; i++) { if (arr[i].variable === data.field) { MsgError(t('views.applicationWorkflow.tip.paramErrorMessage') + data.field) diff --git a/ui/src/workflow/nodes/mcp-node/index.vue b/ui/src/workflow/nodes/mcp-node/index.vue index ca001ca98..53ec8bf1d 100644 --- a/ui/src/workflow/nodes/mcp-node/index.vue +++ b/ui/src/workflow/nodes/mcp-node/index.vue @@ -284,7 +284,7 @@ function changeTool() { )[0].args_schema form_data.value.tool_form_field = [] for (const item in args_schema.properties) { - let params = args_schema.properties[item].properties + const params = args_schema.properties[item].properties if (params) { form_data.value.params_nested = item for (const item2 in params) { diff --git a/ui/src/workflow/nodes/start-node/index.vue b/ui/src/workflow/nodes/start-node/index.vue index 232b43952..d299c0cbf 100644 --- a/ui/src/workflow/nodes/start-node/index.vue +++ b/ui/src/workflow/nodes/start-node/index.vue @@ -86,7 +86,7 @@ const refreshFileUploadConfig = () => { set(props.nodeModel.properties.config, 'fields', fields) return } - let fileUploadFields = [] + const fileUploadFields = [] if (form_data[0].document) { fileUploadFields.push({ label: t('common.fileUpload.document'), value: 'document' }) } diff --git a/ui/vite.config.ts b/ui/vite.config.ts index 00e2415ab..cb0a3d5bf 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -16,6 +16,11 @@ export default defineConfig(({ mode }) => { target: 'http://127.0.0.1:8080', changeOrigin: true, rewrite: (path) => path.replace(ENV.VITE_BASE_PATH, '/'), + } + proxyConf['/oss'] = { + target: 'http://127.0.0.1:8080', + changeOrigin: true, + rewrite: (path) => path.replace(ENV.VITE_BASE_PATH, '/'), } proxyConf['/doc'] = { target: 'http://127.0.0.1:8080',