mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
perf: 修改 acounts 创建提示
This commit is contained in:
@@ -234,9 +234,19 @@ export function getDayFuture(days, now) {
|
||||
|
||||
export function getErrorResponseMsg(error) {
|
||||
let msg = ''
|
||||
const data = error.response && error.response.data || {}
|
||||
const data = error.response && error.response.data || error
|
||||
if (data && (data.error || data.msg || data.detail)) {
|
||||
msg = data.error || data.msg || data.detail
|
||||
} else if (data && data['non_field_errors']) {
|
||||
msg = data['non_field_errors'].join(', ')
|
||||
} else if (Array.isArray(data)) {
|
||||
msg = data.map((item, i) => {
|
||||
let msg = getErrorResponseMsg(item)
|
||||
if (msg) {
|
||||
msg = `${i + 1}. ${msg}`
|
||||
}
|
||||
return msg
|
||||
}).filter(i => i).join('; ')
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@ export function flashErrorMsg({ response, error }) {
|
||||
}
|
||||
|
||||
let timer = null
|
||||
|
||||
function refreshSessionAgeDelay(response) {
|
||||
if (response.request.responseURL.indexOf('/users/profile/') !== -1) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user