瀏覽代碼

时间戳

xuqiaoying 3 年之前
父節點
當前提交
dee8e12284
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/common/tools.js

+ 3 - 1
src/common/tools.js

@@ -128,7 +128,9 @@ export default {
 	 * @returns {*}
 	 */
 	timestampToTime(timestamp, isDay = true,hasChinese) {
-		console.log('timestampToTime---', timestamp)
+		if (!timestamp) {
+			return ''
+		}
 		var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
 		var Y = date.getFullYear() + (hasChinese ? '' : '-');
 		var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + (hasChinese ? '' : '-');