Commit 135caac0fc7c0a3287989879a971b7eeb5f75326

Authored by ww
1 parent eb141885

fix: DEFECT-1731 修复重复提示

@@ -2,12 +2,10 @@ @@ -2,12 +2,10 @@
2 import { ref, unref } from 'vue' 2 import { ref, unref } from 'vue'
3 import { Button, InputGroup, InputPassword, Modal } from 'ant-design-vue' 3 import { Button, InputGroup, InputPassword, Modal } from 'ant-design-vue'
4 import { Icon } from '@iconify/vue' 4 import { Icon } from '@iconify/vue'
5 -import type { AxiosError } from 'axios'  
6 import { useParseParams } from '../LoadData' 5 import { useParseParams } from '../LoadData'
7 import { BasicForm, useForm } from '@/components/Form' 6 import { BasicForm, useForm } from '@/components/Form'
8 import { ComponentEnum, FormLayoutEnum } from '@/components/Form/src/enum' 7 import { ComponentEnum, FormLayoutEnum } from '@/components/Form/src/enum'
9 import { getShareDataByAccessCredentials } from '@/api/content' 8 import { getShareDataByAccessCredentials } from '@/api/content'
10 -import { useMessage } from '@/hooks/web/useMessage'  
11 import type { ConfigurationContentType } from '@/api/content/model' 9 import type { ConfigurationContentType } from '@/api/content/model'
12 10
13 enum FormField { 11 enum FormField {
@@ -40,7 +38,6 @@ const open = async (): Promise<ConfigurationContentType> => { @@ -40,7 +38,6 @@ const open = async (): Promise<ConfigurationContentType> => {
40 } 38 }
41 const { configurationId } = useParseParams() 39 const { configurationId } = useParseParams()
42 40
43 -const { createMessage } = useMessage()  
44 const handleOk = async () => { 41 const handleOk = async () => {
45 await validate() 42 await validate()
46 const value = getFieldsValue() 43 const value = getFieldsValue()
@@ -50,8 +47,6 @@ const handleOk = async () => { @@ -50,8 +47,6 @@ const handleOk = async () => {
50 visible.value = false 47 visible.value = false
51 } 48 }
52 catch (error) { 49 catch (error) {
53 - if (((error as AxiosError)?.response?.data as Record<'msg', string>)?.msg)  
54 - createMessage.error(((error as AxiosError)?.response?.data as Record<'msg', string>)?.msg)  
55 } 50 }
56 } 51 }
57 52
@@ -131,7 +131,8 @@ const transform: AxiosTransform = { @@ -131,7 +131,8 @@ const transform: AxiosTransform = {
131 responseInterceptorsCatch: (_axiosInstance: AxiosInstance, error: any) => { 131 responseInterceptorsCatch: (_axiosInstance: AxiosInstance, error: any) => {
132 const { response, code, message, config } = error || {} 132 const { response, code, message, config } = error || {}
133 const errorMessageMode = config?.requestOptions?.errorMessageMode || 'none' 133 const errorMessageMode = config?.requestOptions?.errorMessageMode || 'none'
134 - const msg: string = response?.data?.message || response?.data || '' 134 + let msg: string = response?.data?.message || response?.data?.msg || response?.data || ''
  135 + msg = isString(msg) ? msg : ''
135 const err: string = error?.toString?.() ?? '' 136 const err: string = error?.toString?.() ?? ''
136 let errMessage = '' 137 let errMessage = ''
137 if (axios.isCancel(error)) 138 if (axios.isCancel(error))