作者 RuoYi

防止时间为空出现的异常

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