优化:文章元数据信息增加所属分类和标签列表
This commit is contained in:
@@ -6,4 +6,18 @@
|
||||
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 = window.location.search.substr(1).match(reg)
|
||||
if (value != null) {
|
||||
return unescape(value[2])
|
||||
}
|
||||
return null
|
||||
}
|
Reference in New Issue
Block a user