防止时间为空出现的异常

feature/model
RuoYi 5 years ago
parent 3436f77c4a
commit 9067369ce0

@ -7,7 +7,7 @@ const baseURL = process.env.VUE_APP_BASE_API
// 日期格式化 // 日期格式化
export function parseTime(time, pattern) { export function parseTime(time, pattern) {
if (arguments.length === 0) { if (arguments.length === 0 || !time) {
return null return null
} }
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'

Loading…
Cancel
Save