修复:启用评论组件

This commit is contained in:
2022-08-13 23:30:56 +08:00
parent 6a3c5bbdd6
commit abd80c6b77
135 changed files with 2234 additions and 128 deletions

View File

@@ -0,0 +1,23 @@
/**
* 格式化时间
* @param date 待格式化时间
* @returns 格式化后的时间(YYYY/MM/dd AM hh:mm)
*/
export function formatDate(date) {
const formatDate = new Date(date)
return formatDate.toLocaleString('zh', {year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric'})
}
/**
* 获取URL路径中的指定参数
* @param paramName 参数名
* @returns 参数值
*/
export function getQueryParam(paramName) {
const reg = new RegExp("(^|&)"+ paramName +"=([^&]*)(&|$)")
let value = decodeURIComponent(window.location.search.substr(1)).match(reg)
if (value != null) {
return unescape(value[2])
}
return null
}