/* 时间戳转换对应格式
unix: 时间戳 str: 对应格式
*/
export function formatUnix(unix, str) {
let l = (unix || "").toString().length,
format = str || "YYYY-MM-DD HH:mm:ss";
if (l == 10) {
return moment.unix(unix).format(format);
} else if (l == 13) {
return moment(Number(unix)).format(format);
} else {
return "";
}
}