modified the 400 error

This commit is contained in:
David 2019-05-31 10:08:55 +08:00
parent 14d0055ba8
commit 6fbbc828d2
1 changed files with 6 additions and 0 deletions

View File

@ -49,6 +49,12 @@ export default function fetchAPI (url, method, data = null, params = null) {
if (!data.detail) {
resolve(data)
} else {
if (data.detail.length === 0) {
data.detail = ''
}
if (data.detail.length === 1) {
data.detail = data.detail[0]
}
notification.error({ message: '错误', description: JSON.stringify(data.detail), key: 'ERROR' })
}
})